'Appium inspector is not able to locate iOS app custom objects

I am using Appium to automate a iOS mobile app, for few elements, Appium inspector is not able to locate XPATH.

I have read that this is because Appium uses Instruments and that can only locate iOS standard objects but not custom objects.

I appreciate any suggestion/help on this.

Example: Need to locate XPATH for radio button in following

app page screen



Solution 1:[1]

Setting the Accessibility Identifier to each element would solve the issue.

You can do it in Interface builder or programatically

view.AccessibilityIdentifier = "CreditCardTextField";

You don't have to use xpath you can just use this as id for the view.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Durai Amuthan.H