In some places we can locate element by accessibility id or by id.
Is one be prefered over the other one while both locators are available?
In some places we can locate element by accessibility id or by id.
Is one be prefered over the other one while both locators are available?
Accessibility Id is a better approach. The main advantage is that it can be set by the developers. So you get it in the way you want. Also, if you want to run scripts cross platform (ie both Android and iOS), then Accessibility Id would be of great help as you can use same ids for both android and ios
Thanks!
SO I want to use accessibility id in my fluentwait however it is missing from the By class.
Any idea how to handle it?
Try this
driver.findElementByAccessibilityId("RootTopLeftMenuButton");
This should work
Thanks
If you want to keep the ‘By’ around:
MobileBy.AccessibilityId(useKey);