51Testing软件测试论坛

标题: Day4-4测试积点任务 [打印本页]

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


作者: abcsell    时间: 2018-4-12 10:13
是不是录制的时候有问题
作者: qqq911    时间: 2018-4-12 10:26
代码之间加上100ms的延迟
作者: 梦想家    时间: 2018-4-12 10:40
应该跟定位没啥关系
作者: 自动化小白    时间: 2018-4-12 11:08
可能是全局变量多,查找属性花费时间长,或者说是其他还没找到的因素

作者: jingzizx    时间: 2018-4-12 13:48
不是定位的问题,你先跑个简单的看下




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