问题
i´m using Appium/TestNG in real devices to automate an application, but some elements have the [@text='string'] with other languages. what´s the best solution to use the same code on other languages instead of creating one code for each language ?
回答1:
Best practice is to never use XPath locators like //*[@text='string']
For Android apps use resource-id
or uiautomator
locator strategies
For iOS apps accessibility-id
or ios class chain
locator strategies
It will help to keep your tests stable and reasonably fast
来源:https://stackoverflow.com/questions/49784859/appium-testng-how-to-identify-an-element-in-other-languages