Appium TestNG - How to identify an element in other languages

时光总嘲笑我的痴心妄想 提交于 2019-12-24 07:39:21

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!