当前位置:   article > 正文

selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred 报错_unknownerror: an unknown server-side error occurre

unknownerror: an unknown server-side error occurred while processing the com

 

问题: 环境使用Python执行appium自动化脚本运行夜神模拟器上的app的时候报错,具体错误信息如下:

selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: The instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output.
Stacktrace:
UnknownError: An unknown server-side error occurred while processing the command. Original error: The instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output.
    at getResponseForW3CError (D:\Program Files\nodejs\node_global\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:804:9)
    at asyncHandler (D:\Program Files\nodejs\node_global\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:392:37)

8d65eddd11dd4b949dbb5f7b6619eb20.png

原因:因为google服务的问题把夜神模拟器删除了以后重新装了,结果Appium服务运行的核心文件Appium Settings就被之前代码里desired_caps中的这一行"skipServerInstallation": "true"执行后跳过 Appium 服务器的安装,所以没有这个文件脚本运行的时候appium日志就会报错导致脚本运行也报错执行失败。

d8ac502d0eb34564a9d968d2fff5d6c8.png

  1. desired_caps = {
  2. "deviceName": "127.0.0.1:62001",
  3. "app": r"D:\Program Files\PycharmProjects\app_pytest_framework\app\xxxx.apk",
  4. "appPackage": "xxxx",
  5. "appActivity": "xxxx",
  6. "platformName": "Android",
  7. "noSign": "true",
  8. "noReset": "true",
  9. "resetKeyboard": "true",
  10. "unicodeKeyboard": "true",
  11. "connectHardwareKeyboard": "true",
  12. "ensureWebviewsHavePages": "true",
  13. "nativeWebScreenshot": "true",
  14. "skipDeviceInitialization": "true",
  15. "skipServerInstallation": "true", #跳过 Appium 服务器的安装,ture为是false为否
  16. "platformVersion": "7.1.2",
  17. "newCommandTimeout": 240,
  18. "automationName": "UiAutomator2"
  19. }
  20. # 打开配置字典中指定的 app
  21. driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", desired_caps)

解决:废话不多说,直接看解决方案,将true改为false,或者直接将这行代码删除,再次运行脚本就成功解决了!

"skipServerInstallation": "false"

转载请注明出处,感谢观看,互相学习!

 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/230123
推荐阅读
相关标签
  

闽ICP备14008679号