Last updated: Apr 10, 2018 20:41
When using the Object Spy, objects that are seemingly the same might be displayed completely different on different devices.
Objects that are retrieved through the object spy, especially when the application is not instrumented, are governed directly by Apple's framework- which essentially decides for each device, under each OS Version, if and how the objects are structured and exposed.
For specific pages or views, this can lead to either objects not being displayed, or a part of the object structure being different.
This can occur both on changes of OS- of course between iOS10 and iOS 11 with the difference between UIAutomation and XCUITest object tree- but also between devices.
For example between IPhone generation 7 (iPhone 7, 7+) and generation 8 (iPhone 8, 8+, X).
This might be caused by the application behaving differently depending on the device or OS, or by the testing framework eg. XCUITest interpreting it differently.
Below is an example for this:
IPhones 7, 7+ :
IPhones 8, 8+, X :
- Work around it by using identifiers that work across all structures
- Talk to the application developer and see if there is a solution on code level, which results in a different tree representation