serenity-bdd / serenity-cucumber-starter

A skeleton project for Serenity BDD and Cucumber JVM
Apache License 2.0
178 stars 280 forks source link

updated Chrome version 114 to 116 #123

Open JRafacand opened 11 months ago

JRafacand commented 11 months ago

Hi, testers! I updated Chrome version 114 to 116. My test didn`t open. It showed the following message: net.thucydides.core.webdriver.DriverConfigurationError: WebDriver was unable to create a new instance of type class org.openqa.selenium.chrome.ChromeDriver WebDriver reported the following message: 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.110 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe

My serenity properties are configurated like this webdriver.driver=chrome webdriver.autodownload=true

Did somebody resolve this problem?

jimmykemp commented 10 months ago

There are a couple of options you can try.

The issue is related to the dependency on 'webdrivermanager', though 'webdrivermanager' is not the issue. The issue you describe has been resolved in v5.50 (for JDK8) and later versions (JDK11) of 'webdrivermanager'. Scan the issues at https://github.com/bonigarcia/webdrivermanager/issues (open and closed), to get an idea of the problem. Long story short, the urls to download the drivers moved from v116 of chrome.

Option 1. In your pom.xml add a dependency to webdrivermanager. This overrides the current version used by Serenity:

<dependency>
       <groupId>io.github.bonigarcia</groupId>
    <artifactId>webdrivermanager</artifactId>
    <version>5.5.0</version>
</dependency>

In your serenity.conf add: autodownload = true

In the section:

webdriver {
  driver = chrome
  autodownload = true
  ......
}

Option 2. Neither of the updates above are required.
Download the drivers manually (either to the default location of 'wdm.cachePath', or specify a location on the command line using the same property), and set -Dwdm.** properties on the command line for the appropriate binary + driver version (e.g. wdm.chromeDriverVersion / wdm.chromeVersion).

Review the webdrivermanager class > 'io.github.bonigarcia.wdm.config.Config' class for which wdm.** options to use.

Summary: Both of these options worked for us. There may be other options to try. We used option 2. until v5.5.0 of webdrivermanager was available, then reverted to option 1.

As a quick test to try out both options. Pull down the v3.9.8 version of https://github.com/serenity-bdd/serenity-cucumber-starter.