Chrome Selenium WebDriver启动和关闭

hfsqlsce  于 2023-08-01  发布在  Go
关注(0)|答案(2)|浏览(134)

我在执行Selenium Java测试时遇到以下错误:

July 11, 2023 6:53:35 PM org.openqa.selenium.remote.service.DriverService$Builder getLogOutput
INFO: Driver logs no longer sent to console by default; https://www.selenium.dev/documentation/webdriver/drivers/service/#setting-log-output
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created: This version of ChromeDriver only supports Chrome version 93
Current browser version is 114.0.5735.199 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe

字符串
我用了其他的chrome驱动程序,它不工作,有人能帮忙吗?

8dtrkrch

8dtrkrch1#

答案似乎已经在日志中了。

This version of ChromeDriver only supports Chrome version 93 Current browser version is 114.0.5735.199 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe

字符串
下载支持Chrome浏览器版本114的最新chromedriver

af7jpaap

af7jpaap2#

更新Selenium版本至 4.6 以上。Selenium Manager将自动负责下载ChromeDriver的匹配版本以执行测试。
所以你的最小代码块将是:

ChromeOptions options = new ChromeOptions();
options.addArguments("--start-maximized");
WebDriver driver = new ChromeDriver(options);

字符串

相关问题