I got hit by this issue with setting up the webdrivers. I had to update my Chrome to 116.0.5845.97. This is how my maven looks like :
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.10.0</version>
</dependency>
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>5.4.1</version>
</dependency>
Code for setting up the chrome Options and finally creating the webdriver:
if (browserName.equals("chrome")) {
WebDriverManager.chromedriver().setup();
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments(new String[]{"--incognito"});
chromeOptions.addArguments(new String[]{"window-size=1980,1080"});
chromeOptions.addArguments(new String[]{"--remote-allow-origins=*"});
this.driver = new ChromeDriver(chromeOptions);
}
I am getting the following error:
Starting ChromeDriver 114.0.5735.90 (386bc09e8f4f2e025eddae123f36f6263096ae49-refs/branch-heads/5735@{#1052}) on port 9006
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
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 (x86)\Google\Chrome\Application\chrome.exe
I have not been able to resolve this issue and hence reaching out to experts here.
java.lang.IllegalStateException: The path to the driver executable The path to the driver executable must be set by the webdriver.chrome.driver system property
– Kinch