Day4-4测试积点任务
问题:pythom+appium跑脚本很慢!点击动作要隔8/9秒左右!
模拟器和真机都是这样!登录的时候不慢,就是登录进去之后每个元素跑起来都很慢,本来以为
是xpath定位慢,但换了其他定位方法还是这样!我觉得是和appium交互的时候是不是有问题!
我的环境是pythom3.5+appium1.7.1!以下是我的代码和appium日志!(本人不会看日志,大
神来解答下,急求!!!)
C:\Users\Administrator\Desktop\慢2.png
<font face="微软雅黑" size="3">
--> POST /wd/hub/session/45d30326-3591-4083-8256-1700b3cf9542/element {"value":"//*[@text='您还未绑定设备,请先绑定!']","using":"xpath","sessionId":"45d30326-3591-4083-8256-1700b3cf9542"}
Calling AppiumDriver.findElement() with args: ["xpath","//*[@text='您还未绑定设备,请先绑定!']","45d30326-3591-4083-8256-1700b3cf9542"]
Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
Waiting up to 10000 ms for condition
Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//*[@text='您还未绑定设备,请先绑定!']","context":"","multiple":false}}
Got data from client: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//*[@text='您还未绑定设备,请先绑定!']","context":"","multiple":false}}
Got command of type ACTION
Got command action: find
Finding '//*[@text='您还未绑定设备,请先绑定!']' using 'XPATH' with the contextId: '' multiple: false
Failed to locate element. Clearing Accessibility cache and retrying.
Finding '//*[@text='您还未绑定设备,请先绑定!']' using 'XPATH' with the contextId: '' multiple: false
Returning result: {"status":7,"value":"No element found"}
Received command result from bootstrap
Waited for 137 ms so far
Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//*[@text='您还未绑定设备,请先绑定!']","context":"","multiple":false}}
Got data from client: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//*[@text='您还未绑定设备,请先绑定!']","context":"","multiple":false}}
Got command of type ACTION
Got command action: find
Finding '//*[@text='您还未绑定设备,请先绑定!']' using 'XPATH' with the contextId: '' multiple: false
Using: UiSelector
Returning result: {"status":0,"value":{"ELEMENT":"5"}}
Received command result from bootstrap
Responding to client with driver.findElement() result: {"ELEMENT":"5"}
<-- POST /wd/hub/session/45d30326-3591-4083-8256-1700b3cf9542/element 200 10806 ms - 87
--> POST /wd/hub/session/45d30326-3591-4083-8256-</font>
是不是录制的时候有问题 代码之间加上100ms的延迟 应该跟定位没啥关系 可能是全局变量多,查找属性花费时间长,或者说是其他还没找到的因素
不是定位的问题,你先跑个简单的看下
页:
[1]