几天前,我用硒做了测试。我今天试图运行我的代码,并收到以下错误消息:
ChromeDriver was started successfully.
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 94
Current browser version is 96.0.4664.55 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google ChromeGoogle chrome将在没有实际测试运行的情况下短暂地打开并立即关闭。我卸载和重新安装谷歌铬和接收相同的问题。我目前正在使用mac,并使用Java运行自动化测试。
我可以帮忙通过这个考试吗?这样我就可以继续工作了。
发布于 2021-11-25 13:16:29
这个错误信息..。
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 94
Current browser version is 96.0.4664.55 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome...implies表示ChromeDriver无法启动/生成一个新的浏览上下文,即Chrome会话。
您的主要问题是您正在使用的二进制文件的版本之间的incompatibility,如下所示:
支持Chrome版本96
支持Chrome版本94
因此,chromedriver=91.0和chrome=96.0.4664.45之间存在明显的不匹配。
解决方案
确保:
发布于 2021-11-26 09:54:22
请等于您的铬和铬驱动器的版本。这个图书馆一直都是这么做的
https://bonigarcia.dev/webdrivermanager/
Steps:
WebDriverManager.chromedriver().setup();
https://stackoverflow.com/questions/70103590
复制相似问题