python+appium-desktop:安卓(android)7.0以上使用appium无法定位元素(无法refresh)且 无法运行脚本

--解决方法:

  启动appium时配置中添加:

"automationName":"uiautomator2"

--扩展:

    想支持安卓7.0及以上版本需要满足一下3点:

    1、使用appium-desktop 1.6.3以及以上版本

    2、启动appium的driver配置添加:"automationName":"uiautomator2"

    3、确保5037端口没有被占用:

      解释:使用appium-desktop 1.6.3以及以上版本测试Android7.0及以上版本,必须使用uiautomator2;

          但是appium的appium-uiautomator2-driver有一个问题,就是它使用的adb端口写死了端口必须是5037(即使在启动appium的driver中设置adbPort也没用)

  

--查看5037端口占用情况

  netstat -ano | findstr 5037 

  

 

posted @ 2018-10-19 15:46  沐风er行  阅读(1723)  评论(0编辑  收藏  举报