Appium TestNG-如何识别其他语言的元素 [英] Appium TestNG - How to identify an element in other languages
本文介绍了Appium TestNG-如何识别其他语言的元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
最佳做法是永远不要使用//*[@text='string']
对于 Android 应用,请使用resource-id
或uiautomator
定位器策略
对于 iOS 应用accessibility-id
或ios class chain
定位器策略
这将有助于保持测试的稳定性和合理的速度
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 ?
解决方案
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
这篇关于Appium TestNG-如何识别其他语言的元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文