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即可。

欢迎技术交流:

相关推荐
程序员龙叔4 小时前
编写高质量 Skill 系列 -- 如何设计需求分析与用例生成的 SKILL
自动化测试·软件测试·python·软件测试工程师·接口测试·性能测试·skill·ai测试
用户8356290780516 小时前
使用 Python 操作 Word 内容控件
后端·python
码云骑士8 小时前
32-慢查询排查全流程(下)-索引优化实战与最左前缀原则
python
闵孚龙9 小时前
《PyTorch 深度修炼》Dataset 和 DataLoader:数据如何喂给模型
人工智能·pytorch·python
goldenrolan9 小时前
A公司物料替代测试系统 v1.7:从需求到 exe/apk 的 AI 辅助全链路实践
android·自动化测试·软件测试·python·ai
菜板春9 小时前
jupyter入门-手册-特征探索
python·jupyter
Metaphor6929 小时前
使用 Python 将 PDF 转换为 HTML
python·pdf·html
极光代码工作室9 小时前
基于数据仓库的电商数据分析平台
大数据·hadoop·python·spark·数据可视化
开发小能手-roy9 小时前
StringBuilder vs StringBuffer:2024年还需要线程安全字符串吗?
开发语言·python·安全