I’m facing an iOS app with a really really big DOM in some screens. The DOM is formed by XCUITest elements (using XCUITest automationName capability).
Generally the whole execution is slow on iOS, but in those heavy screens the execution gets EXTREMELLY slow… Often the session timeouts while locating some element and test crashes.
I know XPath location strategy is very low on iOS, but even looking for an id (By.id) find for an element is really slow. From Appium inspector the behavior is the same.
I suspect I’m not facing this situation correctly, so there goes a bunch of questions:
XCUITest is currently the best automation engine to use for iOS?
There exists some capability like Android’s ‘ignoreUnimportantViews’ for DOM preprocessing? (Truncating the DOM to only on screen elements for example)
Which is the best location strategy? I assume it’s looking for id.
Principal causes of slowness iOS scripts?
Any suggestion for get my scripts quicker?
I’m using Appium server 1.9 and a iOS 11 system on a real device if it helps.
No, there is no such capability. XCUITest does not provide any information on which views are not important. Excluding elements by their visible attribute can bring multiple false positives
What IF you supply a capability useJSONSource : True
I definitely noticed a lot of difference when using this flag in my tests, especially on iPads.
Goto for more details : https://github.com/appium/appium-xcuitest-driver
I use pageSourceExcludedAttributes: Settings - Appium XCUITest Driver
As arguments, I have “type,accessible,index”.
I was using useJSONSource before. However, I noticed better performance with pageSourceExcludedAttributes.