测试积点老人 发表于 2019-6-26 09:33:45

appium执行脚本很慢!点击按钮要隔8、9秒间隔!!

模拟器和真机都一样,登录的时候不慢,就是登录进去后每个元素执行都要8、9秒左右,本以为是xpath定位慢,但换个定位方法还是一样!!我感觉是和appium交互有关系!我的环境是python3.5+appium1.7.1!以下是我的脚本和日志!(本人不会看日志,来大神解答!急求)

--> 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-

海海豚 发表于 2019-6-27 09:39:23

你这设置了等待时间为10s

小小猎魔人 发表于 2019-6-27 10:07:39

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:42

去掉等待时间
页: [1]
查看完整版本: appium执行脚本很慢!点击按钮要隔8、9秒间隔!!