newuser
newuser

Reputation: 317

Chromedriver versions are labelled differently in chromium website and maven repository. Which one to consider for chromedriver?

I see chromedriver is available on https://sites.google.com/a/chromium.org/chromedriver/ and also on https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-chrome-driver. However the versions are different in both cases.

In chromium website, it is mentioned as Current stable release: ChromeDriver 84.0.4147.30

In maven repository, it is mentioned as 4.0.0-alpha-6 as latest artifact.

Question: What is the difference between both and which one should be included as a project dependency for chromedriver.exe ? I am using a selenium java testng project.

Upvotes: 1

Views: 1422

Answers (2)

Jyoti Prakash
Jyoti Prakash

Reputation: 4027

To understand these we need to first understand following:

  1. ChromeDriver is a standalone server that implements the W3C WebDriver standard. https://chromedriver.storage.googleapis.com/index.html is location of executables from google.

  2. WebDriver is an open source tool for automated testing of webapps across many browsers. It provides capabilities for navigating to web pages, user input, JavaScript execution, and more. https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-chrome-driver is location of mvn dependences to interact with ChromeDriver executable. So have selenium-chrome-driver ChromeDriver class : A WebDriver implementation that controls a Chrome browser running on the local machine.

Some more good read links:

Upvotes: 1

undetected Selenium
undetected Selenium

Reputation: 193338

You are partially correct as they are different.

The ChromeDriver you see at ChromeDriver - WebDriver for Chrome is the executable binary which we use most commonly as in:

  • Java:

    System.setProperty("webdriver.chrome.driver","C:\\WebDrivers\\chromedriver.exe");
    WebDriver driver =  new ChromeDriver();
    driver.get("https://www.google.com/");
    
  • Python:

    from selenium import webdriver
    
    driver = webdriver.Chrome(executable_path=r'C:/path/to/chromedriver.exe')
    driver.get("https://www.google.com/")
    

Where as the installation of Selenium libraries for Selenium-Java clients can be done using as well just by adding the selenium-java dependency in your project pom.xml which would support running your automation project with all Selenium supported browsers:

<dependency>
  <groupId>org.seleniumhq.selenium</groupId>
  <artifactId>selenium-java</artifactId>
  <version>3.X</version>
</dependency>

But if you want to run tests only in a specific browser, e.g. Chrome, you can add the Chrome specific dependency in the project pom.xml file as follows:

<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-chrome-driver -->
<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-chrome-driver</artifactId>
    <version>4.0.0-alpha-6</version>
</dependency>

The artifacts within Selenium Chrome Driver is the Selenium bindings specifically for the ChromeDriver and combo.

Upvotes: 2

Related Questions