Our team recently updated our test framework from Calabash to Appium 1.10.0, and I was hoping someone could share some insights on a problem we’ve run into with accessing elements in our native iOS app via Appium. The app contains several views for which our accessibility team has specifically requested that only the main view be visible for accessibility purposes - for example, a view that contains separate subviews for an item’s color and size should be handled as a single swipe that reads off both text labels when navigating the app with VoiceOver. When using Calabash, we were able to locate all of the individual views by
accessibility_id, but with the switch to Appium, we find that the subviews are not visible, and we can only select the ‘parent’ view.
Others have experienced the same issue with Appium, and the answer given previously was to make sure that the parent container view is NOT labelled as accessible, while the subviews are: https://github.com/appium/appium/issues/6517#issuecomment-298037046. This solution won’t work for us, as our accessibility team has requested that only the parent container be accessible.
Here is an example of the elements we see when viewing the app tree/source in Calabash vs. Appium (note - I am not able to share the actual app data - these are representative of what we’re seeing):
[UIView] [UIView] [label: red, XL] [UIView] [UILabel] [id:color] [label:red] [text:red] [UILabel] [id:size] [label:XL] [text:XL] [UIImageView] [id:item_img] [UIView]
<XCUIElementTypeOther type="XCUIElementTypeOther enabled="true" visible="true" x="0" y="426" width="375" height="100"> <XCUIElementTypeButton type="XCUIElementTypeButton" name="red, XL" label="red, XL" enabled="true" visible="true" x="0" y="456" width="375" height="121" /> <XCUIElementTypeOther type="XCUIElementTypeOther enabled="true" visible="false" x="10" y="536" width="355" height="1"/> </XCUIElementTypeOther>
As shown in the examples, Calabash allows us to access the individual elements (
item_img), but these views are not found in the Appium XML source - only the parent node (
XCUIElementTypeButton) is available in the page source.
We’re curious if anyone else has encountered a similar problem with Appium, and been able to come up with a solution. Unfortunately, I’m prevented from sharing code/logs by company policy, but please let me know if there’s any other information I can provide.