Appium TestNG - 如何识别其他语言中的元素 [英] Appium TestNG - How to identify an element in other languages

查看:43
本文介绍了Appium TestNG - 如何识别其他语言中的元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在真实设备中使用 Appium/TestNG 来自动化应用程序,但某些元素在其他语言中具有 [@text='string'].在其他语言上使用相同代码而不是为每种语言创建一个代码的最佳解决方案是什么?

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 ?

推荐答案

最佳实践是永远不要使用像 //*[@text='string']

Best practice is to never use XPath locators like //*[@text='string']

对于 Android 应用程序使用 resource-iduiautomator 定位器策略

For Android apps use resource-id or uiautomator locator strategies

对于 iOS 应用程序 accessibility-idios 类链 定位器策略

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆