Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How do I stay ahead with the latest WebDriver version on Selenium

Since the browser update yesterday my test won’t start and I get the message:

There was an error creating WebDriver object for Chrome

I use Selenium Jupiter with the @TestTemplate and my browsers.json looks:

{
  "browsers": [
    [
      {
        "type": "chrome",
        "version": "latest"
      }
    ]
  ]
}

Here my dependencies:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-java</artifactId>
      <version>4.14.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.github.bonigarcia</groupId>
      <artifactId>webdrivermanager</artifactId>
      <version>5.5.3</version>
    </dependency>
    <dependency>
      <groupId>io.github.bonigarcia</groupId>
      <artifactId>selenium-jupiter</artifactId>
      <version>4.3.7</version>
      <scope>test</scope>
    </dependency>

I thought that the webdrivermanager would solve that version issues.
My experience with Selenium is not so huge, because I use that only for a few weeks.

Is there a solution to keep up with the latest browser versions?

>Solution :

You’re using WebDriverManager, which should generally handle the browser-driver compatibility. But sometimes issues still occur, especially after browser updates. Here are some debugging and resolution steps:

  1. Check Chrome Version: Make sure your local Chrome version matches with the ChromeDriver being downloaded. If not, update Chrome.

  2. Force Update WebDriverManager: Before initializing WebDriver, call:

    WebDriverManager.chromedriver().forceDownload().setup();
    

    This will force WebDriverManager to download the latest version.

  3. Logs: Look at WebDriverManager logs to identify what’s being downloaded. You can enable logging by adding the following to your log4j.properties or equivalent:

    log4j.logger.io.github.bonigarcia=DEBUG
    
  4. Manual Download: As a last resort, manually download the compatible ChromeDriver and set its path:

    System.setProperty("webdriver.chrome.driver", "/path/to/chromedriver");
    
  5. Dependencies: Update WebDriverManager and Selenium-Jupiter to their latest versions in your pom.xml.

If you’ve tried all of these and the issue persists, it might be a bug and reporting it would be beneficial.

Remember, if you’re running tests in a CI/CD environment, make sure to update Chrome and ChromeDriver there as well.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading