selenium执行出现异常,SessionNotCreatedException ChromeDriver only supports

问题现状:

运行程序报错:

selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 114

Current browser version is 121.0.6167.85 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

问题出现原因:

系统的chrome浏览器自动升级了,导致selenium依赖的chrome内核版本不一致造成的问题。

如何解决?

我们只需要去下载一个对应版本的内核chromedriver就行了。

Chrome内核下载页:https://sites.google.com/chromium.org/driver/

进入下载详情页:https://googlechromelabs.github.io/chrome-for-testing/

主要找到对应的版本以及对应自己电脑的版本,记得是下载ChromeDriver,复制那个url,然后直接下载就好了。

下载下来的是一个bin文件

安装只需要配置环境变量就行了:

将chromedriver文件所在路径加入到环境变量PATH里就行,或者直接将文件copy到/usr/local/bin目录也行。

相关推荐
se-tester7 天前
JMeter、Postman 和 SoapUI 在做接口测试上的优势和缺点
测试工具·jmeter·接口测试·postman·soapui
xixi09247 天前
selenium IDE——command
selenium·测试工具
xixi09247 天前
selenium IDE安装使用教程
ide·selenium·测试工具
Wpa.wk8 天前
har文件转为接口自动化测试用例
运维·测试工具·自动化·测试用例·接口自动化
Wpa.wk8 天前
ubuntu22桌面版安装
经验分享·测试工具
uyeonashi8 天前
自动化测试问卷考试系统测试报告
功能测试·selenium·github
007张三丰8 天前
软件测试专栏(6/20):Selenium从0到1实战指南:元素定位、等待机制与框架封装
selenium·测试工具
测试老哥8 天前
如何使用Postman做接口测试?
自动化测试·软件测试·python·测试工具·测试用例·接口测试·postman
安全不再安全8 天前
某驱动任意读漏洞分析 - 可用于游戏内存数据读取
c语言·测试工具·安全·游戏·网络安全