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 小时前
Pydantic校验配置文件
python
hboot2 小时前
AI工程师第四课 - 深度学习入门
pytorch·python·神经网络
ZhengEnCi13 小时前
P2M-Matplotlib折线图完全指南-从数据可视化到趋势分析的Python绘图利器
python·matlab·数据可视化
ZhengEnCi15 小时前
P2L-Matplotlib饼图完全指南-从数据可视化到图表定制的Python绘图利器
python·matlab
曲幽15 小时前
你的REST接口还在“过度投喂”数据吗?——FastAPI + GraphQL实战避坑指南
python·fastapi·web·graphql·route·cors·rest·strawberry
用户83580861879116 小时前
基于 Self-RAG 与列表级重排序的进阶 RAG 系统设计与实现
python
Warson_L1 天前
Python `Annotated` 与 LangGraph Reducer 学习笔记
python
韩师傅1 天前
海天线算法的前世今生
python·计算机视觉
韩师傅1 天前
当你的甲方设备过烂,要如何快速出效果?
python·计算机视觉
Warson_L1 天前
LangGraph的MessageState and HumanMessage
python