APPIUM 無法獲得彈出層的控件的解決方式

問題:appium 無法獲得彈出的 提示升級對話框。

平臺:win 10+ node版APPIUM +魅族 + android 7.1.2

 

解決流程:

1. 啓用UIautomator2  

"automationName": "uiautomator2"

2. 使用uiautomator的內置JAVA命令選擇相關控件,不要使用XPATH或者id一類的。

driver.find_element_by_android_uiautomator('new UiSelector().className(\"android.widget.TextView\").textContains(\"取消\")')

完美解決問題

如果你看懂了將會爲你節省 3.5小時左右。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章