安卓app里面的網頁,基本上都是使用手機系統上的webview 去顯示的。
安卓 webview 可以看成是 手機上的 chrome 瀏覽器精簡版。
appium desktop 里面內置了 用於 webview 自動化的 chromedriver
手機里webview也有一個版本
這樣可能會出現appium desktop里面的 chromedriver 與手機里面的不匹配問題
selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: No Chromedriver found that can automate Chrome '78.0.3904'. See https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/web/chromedriver.md for more details. You could also try to enable automated chromedrivers download server feature
selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: A new session could not be created. Details: session not created: This version of ChromeDriver only supports Chrome version 78
手機上webview版本
這樣去下載與webview中版本一致的Chromedriver
然后設置chromedriver路徑,重新啟動就可以了
參考:http://www.python3.vip/doc/blog/python/2018081702/