1

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.

newuser
  • 307
  • 3
  • 24

2 Answers2

1

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.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • Is there any dependency available in maven repository to pull chromedriver.exe to avoid manual download and setting it’s path in the code? Such dependency is available as Selenium Chrome driver in nuget package manager for C# tests that gets chromedriver.exe and copies to bin folder during build. – newuser Jul 24 '20 at 03:13
  • I see one maven dependency - WebDriverManager from bonigarcia which does it or use driver-binary-downloader maven plugin from Adresco. Are there any latest ways or just follow one among these ? – newuser Jul 24 '20 at 04:04
  • @newuser That's right, _chromedriver.exe to avoid manual download_ WebDriverManager from bonigarcia is the solution. But it does have some side effects which is again another big discussion. – undetected Selenium Jul 24 '20 at 08:47
1

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:

Jyoti Prakash
  • 3,921
  • 3
  • 21
  • 24