【发布时间】:2019-08-12 10:26:01
【问题描述】:
enter image description hereenter image description here我无法在我的移动应用中使用任何使用 appium 的定位器找到元素,请查看随附的屏幕截图和下面的代码
driver.findElementById("serviceUrl").sendKeys("ABC");
driver.findElementByClassName("android.widget.Button").click();
Appium 服务器响应
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] 从客户端获取数据:{"cmd":"action","action":"find","params":{"strategy":"xpath" ,"selector":"//[@class='android.widget.EditText']","context":"","multiple":false}} [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] 得到了 ACTION 类型的命令 [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] 得到命令动作:find [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] 使用 'XPATH' 和 contextId: '' multiple: false [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] 定位元素失败。清除辅助功能缓存并重试。 [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] 使用 'XPATH' 和 contextId: '' multiple: false [debug] [AndroidBootstrap] 从 bootstrap 收到命令结果 [调试] [MJSONWP] 匹配 JSONWP 错误代码 7 到 NoSuchElementError
【问题讨论】:
-
你是如何声明和初始化你的驱动的?请在您的原始帖子中显示代码。