appium 報錯:selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Can't stop process; it's not currently runni...


appium進行手機瀏覽器的自動化測試代碼如下,但報錯了

#使用手機瀏覽器進行自動化測試
import time from appium import webdriver #自動化配置信息
des={ 'platformName': 'Android', 'platformVersion': '8.0', #填寫android虛擬機的系統版本
'deviceName': 'SamSung Galaxy S9', #填寫安卓虛擬機的設備名稱---值可以隨便寫
'browserName': 'chrome', # 直接指定瀏覽器名稱參數為chrome【重點添加了這一步】
'udid': '192.168.235.103:5555', # 填寫通過命令行 adb devices 查看到的 uuid
'noReset': True, # 確保自動化之后不重置app
'unicodeKeyboard': True, 'resetKeyboard': True, 'chromedriverExecutable': r"C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win\chromedriver.exe" #使用指定的瀏覽器驅動-匹配手機上的谷歌瀏覽器
} driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', des) driver.implicitly_wait(5) driver.get('http://hao.uc.cn/') #打開UC網頁

 

報錯如下:

selenium.common.exceptions.WebDriverException:
Message: An unknown server-side error occurred while processing the command. Original error: Can't stop process;
it's not currently running (cmd: ''C:/Program Files/Appium/resources/app/node_modules/appium/node_modules/appium-chromedriver/chromedriver/win/chromedriver.exe' --url-base\=wd/hub --port\=8001 --adb-port\=5037 --verbose')

 

 

 

原因

折騰了相當久 ,差不多兩個晚上才找到原因,代碼沒有問題,問題出在手機瀏覽器版本與chromedriver版本不一致導致的

解決辦法

下載與瀏覽器版本一致的驅動后,替換appium中的驅動即可,再次啟動就成功了。

我的appium是默認安裝的,驅動地址在:C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win,進入win文件夾中替換原有的驅動。

 

Chromedriver 下載地址

 

對應瀏覽器版本的Chromedriver下載地址:https://npm.taobao.org/mirrors/chromedriver

chromedriver版本匹配地址:https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/web/chromedriver.md

 

參考文章:https://blog.csdn.net/qq_32722729/article/details/103201616

 


免責聲明!

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



猜您在找 Appium(四) selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: You must include a platformName capability Appium問題解決方案(8)- selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Could not sign with default certificate. 解決:切換context時報錯selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command... Appium異常:An unknown server-side error occurred while processing the command. Original error: Could n appium報錯:An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: read ECONNRESET Appium報錯: An unknown server-side error occurred while processing the command. Original error: java.lang.SecurityException: Injecting to another application requires INJECT_EVENTS permission An unknown server-side error occurred while processing the command.處理 python appium自動化報“Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server Win10上啟動UICrawler自動遍歷時報 "org.openqa.selenium.WebDriverException: An unknown server-side error occur red while processing the command. Original error: Could not sign with default certifi cate." python+appium運行提示找不到adb.exe “An unknown server-side error occurred while processing the command. Original error: Could not find 'adb.exe' in ["D:\\adt\\sdk;\\platform-tools\\adb.exe"”
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM