No Chromedriver found that can automate Chrome ‘x.x.xxxx‘的解决办法

一、前置说明

在使用Appium对Android设备自动化测试时,切换WebView时抛出异常:

selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: No Chromedriver found that can automate Chrome '92.0.4515'. You could also try to enable automated chromedrivers download as a possible workaround.

这是因为在启动Appium时,没有指定chromedriver导致。

二、解决方案

1、手动方案

1)根据错误提示中的版本号,下载对应的chromedriver

No Chromedriver found that can automate Chrome '92.0.4515'. 根据这个提示,下载 '92.0.4515'版本的chromedriver。

下载地址:chromedriver阿里云镜像站

2)启动Appium时,在capabilities中指定chromedriverExecutable的路径

复制代码
capabilities = {
        "platformName": "Android",
        "automationName": "uiautomator2",
        "deviceName": "127.0.0.1:62001",
        "app": "D:\\resources\\ApiDemos-debug.apk",
        'chromedriverExecutable': 'D:\\resources\\chromedriver_92.0.4515.exe'  # 添加这行代码
    }

2、自动方案

Appium 从 1.15.0开始,支持自动下载与当前测试设备webview版本一致的chromedriver。只需要以appium --allow-insecure chromedriver_autodownload启动appium即可。

欢迎技术交流:

相关推荐
知行合一。。。2 小时前
Python--04--数据容器(总结)
开发语言·python
架构师老Y2 小时前
008、容器化部署:Docker与Python应用打包
python·容器·架构
lifewange3 小时前
pytest-类中测试方法、多文件批量执行
开发语言·python·pytest
pluvium273 小时前
记对 xonsh shell 的使用, 脚本编写, 迁移及调优
linux·python·shell·xonsh
2401_827499993 小时前
python项目实战09-AI智能伴侣(ai_partner_5-6)
开发语言·python
PD我是你的真爱粉3 小时前
MCP 协议详解:从架构、工作流到 Python 技术栈落地
开发语言·python·架构
ZhengEnCi4 小时前
P2G-Python字符串方法完全指南-split、join、strip、replace的Python编程利器
python
是小蟹呀^4 小时前
【总结】LangChain中工具的使用
python·langchain·agent·tool
宝贝儿好4 小时前
【LLM】第二章:文本表示:词袋模型、小案例:基于文本的推荐系统(酒店推荐)
人工智能·python·深度学习·神经网络·自然语言处理·机器人·语音识别
王夏奇4 小时前
pythonUI界面弹窗设置的几种办法
python·ui