iOS list views and tree view take 5min to complete findElement calls

Using iOS XCUITest, when I attempt to locate any element on our apps homeview, which contains a list / feed the findElement call can take in excess of 5 minutes per call. As a coupe of elements are being located on this view in various tests it can take hours to complete all. I have tried both accessibility id and xpath but the difference in time is negligible. If we disable loading the list / feed contents in xcode and rebuild, the time is quick.

Using the appium GUI we get the element tree view and can see that 100+ items are in the list view, however we have not scrolled down the list to load or populate these row elements. Is there any reason why appium with iOS would be showing these in the tree view, and not just the elements that have been loaded and are in view?

It takes so long because of the amount of elements present in the list. And it is doing verification for each of those elements to see if they are visible or not.

On those list try querying for visible elements only using:

driver.findElementsByIosNsPredicate(...

Check more information in:

Thanks, this has sped up things a little for each findElement call, but overall it is still painfully slow.

Still cant understand why 100’s of list items are being loaded into the view tree which seems to be the source of the slowness. Other views complete in seconds. Will either have to reduce test data or find another solution.