SessionNotCreatedException:无法启动新会话

问题描述 投票:0回答:1

我需要解决这个问题。我过去三天就面临这个问题。

Aug 23, 2023 9:51:48 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
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 114
Current browser version is 116.0.5845.97 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe 
Host info: host: 'DESKTOP-2CR94PT', ip: '192.168.176.203'
Build info: version: '4.10.0', revision: 'c14d967899'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '20.0.1'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [--remote-allow-origins=*], extensions: []}}]}]
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:140)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:96)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:68)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:163)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:196)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:171)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:531)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:227)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:154)
    at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:107)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:87)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:82)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:50)
    at test.Seleniumscript.main(Seleniumscript.java:14)
google-chrome selenium-webdriver version http-status-code-500 undetected-chromedriver
1个回答
0
投票

快速修复: 只需将您的 selenium 版本从

v4.10.0
升级到
v4.11.0

问题:由于您使用的是chrome版本

116
,兼容的selenium web驱动程序版本是最新的,即
v4.11.0

https://stackoverflow.com/a/76912466/7598774

© www.soinside.com 2019 - 2024. All rights reserved.