【发布时间】:2018-12-19 08:20:11
【问题描述】:
ENV:- Appium 最新 1.6.4,Android 7.1.1
我在使用 appium 时遇到了问题,我测试了在 android 本机应用程序登录屏幕上登录,关闭最新弹出窗口并在下一个活动时按下菜单按钮。在此活动中,appium 无法获取任何元素。也无法获取页面源。它尝试执行任何操作并无限期挂起,直到应用程序或测试关闭。在此之前,所有操作都执行良好。我想不通。我的应用程序有问题吗?感觉appium在activity上看不到任何东西。
Appium 日志:
[AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:click”,“params”:{“elementId”:“6”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:click”,“params”:{“elementId”:“6”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: click
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:true}
[AndroidBootstrap] Received command result from bootstrap
[W3C] Responding to client with driver.click() result: true
[HTTP] <-- POST /wd/hub/session/d74e0285-8c9f-48b1-9b86-963572ea80a9/element/6/click 200 3166 ms - 14
[HTTP]
[HTTP] --> POST /wd/hub/session/d74e0285-8c9f-48b1-9b86-963572ea80a9/element
[HTTP] {“using”:“xpath”,“value”:"//android.widget.EditText[contains(@resource-id,‘com.myapp:id/messageEdit’)]"}
[W3C] Calling AppiumDriver.findElement() with args: [“xpath”,"//android.widget.EditText[contains(@resource-id,‘com.myapp:id/messageEdit’)]",“d74e0285-8c9f-48b1-9b86-963572ea80a9”]
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Waiting up to 30000 ms for condition
[AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“xpath”,“selector”:"//android.widget.EditText[contains(@resource-id,‘com.myapp:id/messageEdit’)]",“context”:"",“multiple”:false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“xpath”,“selector”:"//android.widget.EditText[contains(@resource-id,‘com.myapp:id/messageEdit’)]",“context”:"",“multiple”:false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘//android.widget.EditText[contains(@resource-id,‘com.myapp:id/messageEdit’)]’ using ‘XPATH’ with the contextId: ‘’ multiple: false
【问题讨论】: