【发布时间】:2017-01-13 01:58:19
【问题描述】:
我正在使用来自 experitest.com 的 Seetest Automation,更准确地说,我正在使用 Seetest Automation 的 MobileWebDriver 实现,正如 experitest 所说“...对于移动浏览器 [...],它还可以用于自动化 Native应用程序”。
所以,我在 Seetest 下启动我的检测应用程序,然后打开检查器“object spy”。这个检查器非常酷,因为您可以单击应用程序的某些屏幕元素,检查器将自动在 DOM 中显示节点及其所有属性。检查器可以验证屏幕 DOM 的 xpath 表达式,因此您可以轻松验证 xpath 表达式对于您正在寻找的元素是否正确。
我有一个 xpath://*[@text='Login']
该 xpath 已通过 object spy 验证,它能够找到我正在寻找的元素。
所以,我验证了按钮的 xpath 表达式,下面是执行点击的 Seetest 客户端:
MobileWebDriver driver = new MobileWebDriver("localhost", 8889);
driver.client.setDevice(mydevice.ID);
// Launch instrumented app
driver.client.launch(myapp.activity, true, true);
driver.findElementByXPath("//*[@text='Login']").click();
前四行不正常。有问题?遗漏了什么? ¿ 仪表化与未仪表化?
前四行的例外:
com.experitest.client.InternalException: Exception caught while executing click: Element was not identified: 'xpath=//*[@text='Login']' at zone NATIVE
我正在使用 Seetest 的 MobileWebDriver 实现,因为我需要与一些 selenium/appium 代码兼容/集成。
谢谢,希望有人知道!
【问题讨论】:
标签: java android selenium xpath automation