ios – XCUIElement.exists fails when element is offscreen


I have an XCUITest that selects a file from the Files app. When the file is offscreen and needs to be scrolled to, ‘exists’ evaluates to false. When I scroll the screen to make the element visible, then ‘exists’ evaluates to true.

I’m running Xcode 15.

In other posts I’ve read through, it looks like ‘exists’ should be true when the element is on the screen and in the hierarchy even if the element is not visible at that moment and needs to be scrolled to…

Both of these ways of referencing the element operate similarly:

app.cells.matching(identifier: fileIdentifier).firstMatch.exists

app.otherElements.matching(identifier: fileIdentifier).firstMatch.exists

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img