如何使用Uiautomate查看器在appium中创建xpath?

时间:2016-01-17 23:39:37

标签: android selenium mobile automated-tests appium

如何使用Uiautomate viewer在appium中创建xpath。在这里找到附加的截图我只有内容描述。通过这个我如何识别注册按钮?enter image description here

2 个答案:

答案 0 :(得分:0)

在UIAutomator中按content-desc属性定位类似于在selenium / Appium中按name属性定位,

driver.findElement(By.name("Sign Up"));

答案 1 :(得分:0)

使用uiautomate查看器的xpath与在浏览器上创建的几乎相同。 例如,在附加的屏幕截图中,突出显示的屏幕截图有xpath: //android.view.View[@content-desc='注册']

通用格式:// [类] [其他参数]