Appium获取toast消息遇到的问题

发布时间:2019-03-12 22:59:43编辑:auto阅读(2194)

    一、运行错误

    Android获取toast,需要在参数里设置automationName:Uiautomator2

     1     # 设置设备的信息
     2     desired_caps = {
     3         'platformName': 'Android',  # 平台
     4         'platformVersion': '5.1',  # 版本号
     5         'deviceName': 
     6         'appPackage': 
     7         'appActivity': 
     8         'unicodeKeyboard': 'True',  # 防止键盘中文不能输入
     9         'resetKeyboard': 'True',  # 重置设置生效
    10         'automationName': 'Uiautomator2',
    11         'noSign':'True'
    12     }

     

    在参数里设置后,运行脚本,提示Uiautomator2错误, 后经查询appium1.6.3以上才能识别toast,

    于是去github官网下载最新版本:https://github.com/appium/appium-desktop/releases,仍未解决;

    几经折腾最后发现在安装appium-desktop的时候需要将安装模式设置为只为此用户安装,运行后没有在提示错误,正常运行

     

    参考链接:https://testerhome.com/topics/15224

关键字