Should All Elements Have Unique Class Name In A Native Android Application?
I used UI automation viewer to get an xpath selector for class and Appium driver states (correctly) that: *** Capybara::Ambiguous Exception: Ambiguous match, found 4 elements match
Solution 1:
When I launched the app in Appium Inspector, it said: "Using XPath locators is not recommended and can lead to fragile tests. Ask your development team to provide unique accessibility locators instead!" Ideally, it should instead autogenerate a short and unique selector.
For Android, either resource-id
or content-desc
should not be empty and if possible should contain unique values.
For iOS, it's accessibility-id
or name
.
Based on: http://appium.io/docs/en/commands/element/find-elements/
Solution 2:
Ya, but as you can see i have nothing else than XPATH.
Post a Comment for "Should All Elements Have Unique Class Name In A Native Android Application?"