51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 2370|回复: 3
打印 上一主题 下一主题

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

[复制链接]
  • TA的每日心情
    无聊
    昨天 09:47
  • 签到天数: 528 天

    连续签到: 1 天

    [LV.9]测试副司令

    跳转到指定楼层
    1#
    发表于 2019-6-26 09:33:45 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    1测试积点
    模拟器和真机都一样,登录的时候不慢,就是登录进去后每个元素执行都要8、9秒左右,本以为是xpath定位慢,但换个定位方法还是一样!!我感觉是和appium交互有关系!我的环境是python3.5+appium1.7.1!以下是我的脚本和日志!(本人不会看日志,来大神解答!急求)

    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-
    复制代码


    附件: 您需要 登录 才可以下载或查看,没有帐号?(注-册)加入51Testing
    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    11 小时前
  • 签到天数: 1803 天

    连续签到: 2 天

    [LV.Master]测试大本营

    2#
    发表于 2019-6-27 09:39:23 | 只看该作者
    你这设置了等待时间为10s
    回复

    使用道具 举报

  • TA的每日心情
    开心
    2019-7-12 09:26
  • 签到天数: 9 天

    连续签到: 1 天

    [LV.3]测试连长

    3#
    发表于 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之类的方法试一下
    回复

    使用道具 举报

  • TA的每日心情
    慵懒
    10 小时前
  • 签到天数: 1518 天

    连续签到: 2 天

    [LV.Master]测试大本营

    4#
    发表于 2019-6-27 10:38:42 | 只看该作者
    去掉等待时间
    回复

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-11-19 20:40 , Processed in 0.064963 second(s), 23 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表