xcode 11 beta 6 or 7 - XCUIApplication can't find elements that were previously found in older Xcodes

Hi,


We are currently experience issues with Xcode 11 beta 6/7 when running our existing UI tests suite on iOS 13 simulator


Some of the issues we are seeing are:

- when doing queries for elements that are Labels, for example

XCUIApplication().staticTexts["accessibility-identifier-here"].firstMatch

they are not finding the element, instead is categorising it as a button even though it is a label (with a tap gesture recogniser) so changing the query to:

XCUIApplication().buttons["accessibility-identifier-here"].firstMatch

fixes it but it doesn't really make much sense that elements are being categorised differently than before since the code is the same.

- With Xcode 10, while debugging the UI tests we are able to run in the console

expr print(XUIApplication().debugDescription)

and see the elements that are in a modal on the view hierarchy, but with Xcode 11 those elements doesn't seem to be part of the view hierarchy so when trying to "tap" on them programatically it fails. Also, using the record function so that Xcode 11 writes the code for the tap actions, it crashes when tapping on elements that are on that modal, which happen to be the same elements that are missing when printing the view hierarchy on the console. This is completely fine in Xcode 10 but not in Xcode 11


Wondering if other devs are experiencing the same or similar problems and if this is a Known issue that hasn't been updated on the release notes.


Thanks



Replies

debugDescription issue happened since beta4 , this could be related with modal changes on Xcode 11.


Not sure our existing app need updated or this issue comes from XCUITEST framework .

Yes we are not sure either, we could update the code of the UI tests to look for the element on the new categories only for iOS 13, but that means for previous versions of iOS the code will be different, wouldn't like to have `

if #available(iOS 13.0, *)` everywhere on our code

We're experiencing this too, in Xcode 11 GM, labels with tap gesture recognizers have to be accessed through `app.buttons["some static text"]` instead of `app.staticTexts["some static text"]`.

I have the same issue. Any solution rather than rename everything?