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 

  

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM