51Testing软件测试论坛

标题: appium执行脚本很慢!点击按钮要隔8、9秒间隔!! [打印本页]

作者: 测试积点老人    时间: 2019-6-26 09:33
标题: appium执行脚本很慢!点击按钮要隔8、9秒间隔!!
模拟器和真机都一样,登录的时候不慢,就是登录进去后每个元素执行都要8、9秒左右,本以为是xpath定位慢,但换个定位方法还是一样!!我感觉是和appium交互有关系!我的环境是python3.5+appium1.7.1!以下是我的脚本和日志!(本人不会看日志,来大神解答!急求)
[attach]125382[/attach]
  1. [HTTP] --> POST /wd/hub/session/45d30326-3591-4083-8256-1700b3cf9542/element {"value":"//*[@text='您还未绑定设备,请先绑定!']","using":"xpath","sessionId":"45d30326-3591-4083-8256-1700b3cf9542"}
  2. [MJSONWP] Calling AppiumDriver.findElement() with args: ["xpath","//*[@text='您还未绑定设备,请先绑定!']","45d30326-3591-4083-8256-1700b3cf9542"]
  3. [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
  4. [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
  5. [BaseDriver] Waiting up to 10000 ms for condition
  6. [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//*[@text='您还未绑定设备,请先绑定!']","context":"","multiple":false}}
  7. [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//*[@text='您还未绑定设备,请先绑定!']","context":"","multiple":false}}
  8. [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
  9. [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
  10. [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding '//*[@text='您还未绑定设备,请先绑定!']' using 'XPATH' with the contextId: '' multiple: false
  11. [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Failed to locate element. Clearing Accessibility cache and retrying.
  12. [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding '//*[@text='您还未绑定设备,请先绑定!']' using 'XPATH' with the contextId: '' multiple: false
  13. [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":7,"value":"No element found"}
  14. [AndroidBootstrap] Received command result from bootstrap
  15. [BaseDriver] Waited for 137 ms so far
  16. [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//*[@text='您还未绑定设备,请先绑定!']","context":"","multiple":false}}
  17. [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//*[@text='您还未绑定设备,请先绑定!']","context":"","multiple":false}}
  18. [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
  19. [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
  20. [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding '//*[@text='您还未绑定设备,请先绑定!']' using 'XPATH' with the contextId: '' multiple: false
  21. [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.TextView, INSTANCE=3]
  22. [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":0,"value":{"ELEMENT":"5"}}
  23. [AndroidBootstrap] Received command result from bootstrap
  24. [MJSONWP] Responding to client with driver.findElement() result: {"ELEMENT":"5"}
  25. [HTTP] <-- POST /wd/hub/session/45d30326-3591-4083-8256-1700b3cf9542/element 200 10806 ms - 87
  26. [HTTP] --> POST /wd/hub/session/45d30326-3591-4083-8256-
复制代码



作者: 海海豚    时间: 2019-6-27 09:39
你这设置了等待时间为10s
作者: 小小猎魔人    时间: 2019-6-27 10:07
Finding '//*[@text='您还未绑定设备,请先绑定!']' using 'XPATH' with the contextId: '' multiple: false
Returning result: {"status":7,"value":"No element found"}
报了很多这个标签找不到的错误,一直在重试,所以时间很长,换个id,class之类的方法试一下
作者: qqq911    时间: 2019-6-27 10:38
去掉等待时间




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2