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

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.

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 maven 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 google-chrome combo.

To understand these we need to first understand following:
ChromeDriver is a standalone server that implements the W3C WebDriver standard.
https://chromedriver.storage.googleapis.com/index.html is location of executables from google.
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:
What we have in selenium-chrome-driver https://www.javadoc.io/static/org.seleniumhq.selenium/selenium-chrome-driver/4.7.2/index.html?org/openqa/selenium/chrome/ChromeDriver.html
WebDriver commands https://chromium.googlesource.com/chromium/src/+/master/docs/chromedriver_status.md
Change logs for JAVA in selenium versions https://github.com/SeleniumHQ/selenium/blob/trunk/java/CHANGELOG

Related

When replacing selenium jars with latest version under JMeter lib folder 'ConversionException' is thrown

I am working with JMeter and Selenium. Installed the plugins manager and via that, installed web-driver sampler. When I look into lib folder, I found the selenium jars version are 2.52.0 which is much older. I can able to work with that without any issues. But the real problem is:
Using Maven, I updated all the selenium jars to 3.9.1 version and its dependant jars like guava, gson, commons, etc.
Now, when I open the jmx files with WebDriver sampler and driver configs, I receive below error.
Using maven, I mean, I downloaded all the jars from maven repo manually and pasted into JMeter lib folder.
Please help me to work with latest Selenium drivers in JMeter.
You won't be able to use WebDriver Sampler plugin with Selenium 3.9.1 as it explicitly relies on SessionNotFoundException class which has been removed in the latest Selenium libraries.
So the options are in:
Use WebDriver Sampler with browser version(s) supported by Selenium 2.52.0
Reach out to WebDriver Sampler plugin developers and/or maintainers at jmeter-plugins forum to check whether it is planned to update Selenium libraries and if yes - when. You can also update WebDriver Sampler source code by yourself and send pull request to the plugin maintainer.
Switch to JSR223 Sampler and Groovy language instead. Apart from being able to use latest libraries you will have full control of the WebDriver instance using DesiredCapabilities at full instead of limited subset exposed via *Driver Config elements.

What is difference between selenium-server-standalone and selenium-server.

I can see two repository in Maven Central repo. Please clarify what is difference between both jars
This is explained in the Selenium documentation:
You may, or may not, need the Selenium Server, depending on how you
intend to use Selenium-WebDriver. If your browser and tests will all
run on the same machine, and your tests only use the WebDriver API,
then you do not need to run the Selenium-Server; WebDriver will run
the browser directly.
There are some reasons though to use the Selenium-Server with
Selenium-WebDriver.
You are using Selenium-Grid to distribute your tests over multiple
machines or virtual machines (VMs).
You want to connect to a remote
machine that has a particular browser version that is not on your
current machine.
You are not using the Java bindings (i.e. Python, C#,
or Ruby) and would like to use HtmlUnit Driver
The selenium-server-standalone.jar was used in older Selenium versions (with Selenium Server).
Newer versions of Selenium (WebDriver API) uses selenium-java.jar.
As per the Selenium Server jar releases, selenium-server-standalone jars are no more pushed to the Maven Artifact.
Till Selenium Release v2.53.0, selenium-server-standalone jars were pushed to the Maven Artifact separately as Jenkins Releases. But starting Selenium Release v3.x only the selenium-server jars and the selenium-java client jars are pushed to the Maven Artifact
Solution
If you running everything on the same machine, then using the selenium-java client maven dependency should be just fine.
If you running something on a machine that's not your desktop, then using the selenium-server maven dependency must be used. In this case you can also embed the Selenium server into your own project by adding the selenium-server dependency to your pom.xml.
If you intent to use the RemoteWebDriver implementation, then you need to download the selenium-server-standalone.jar from the Selenium Downloads page

How to perform webdriver backed selenium in selenium 3?

How to perform webdriver backed selenium in selenium 3 ?
Selenium 3 has recently removed the feature called 'webdriver backed selenium'
I have to perform mouseover, type operations like this, which is no more supported in Selenium 3.
selenium = new WebDriverBackedSelenium(driver, "http://www.google.com");
selenium.openWindow("http://www.google.com", "google");
selenium.mouseOver(anElement);
I have tried with moveToElement method , But it doesn't executes in my site .
Thats why I was using webdriver backed selenium in Selenium 2 (WebDriver).
What work around I have to do to get this in Selenium 3
As you probably know, WebDriverBackedSelenium provides Selenium 1.x (Selenium RC) compatible interfaces but it's 100% implemented using WebDriver.
There are many downsides to use it, for example - WebDriverBackedSelenium is significantly slower than using WebDriver APIs directly. But let's stick with the original question :)
With the release of Selenium 3.0, it was decided to delete the original Selenium Core implementation. For the one that have used the old RC interfaces, Selenium team have provided an alternative implementation that’s backed by WebDriver which is the same as WebDriverBackedSelenium that has been available as part of Selenium 2 since its release.
This implementation is the Selenium Leg Rc. In order to use it, just include the dependency in your project, for example, using Maven:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-leg-rc</artifactId>
<version>3.0.1</version>
</dependency>
And now you will be able to work as you worked until now, with Selenium 3.0 with WebDriverBackedSelenium.

Suitable Chrome driver to use with selenium tests

I was wandering since there is many chrome drivers available on the nuGet Packages Manager, which one is fitting the best with Selenium tests, does it make any difference at all?
WebDriver ChromeDriver
WebDriverChromeDriver
Selenium.WebDriver.ChromeDriver
etc...
I'm using for my >30K lines of code (and 6 different web-sites) UI test project the
WebDriver ChromeDriver
with version 26.14.313457.1, it's a separate executable that WebDriver uses to control the Chrome browser. Again it requires Chromium/Google Chrome to be installed.

re-development of Chrome webdriver

I hear that webdriver for Chrome is being re-developed as part of the Chromium project (since the original Chrome webdriver of the selenium project is unusable). Does anyone know if development is complete? If so, where can I find the jars? Has it been pushed to maven central yet?
The new Chrome driver has been checked into the Chromium project tree, and the binaries made available on the Selenium project site. The individual language bindings for the Chrome driver will still be included in the Selenium downloads. Information about what is required to run the new Chrome driver can be found in the project wiki. Note that Chrome 12.0.712.0 or higher is required to work with the new Chrome driver.
The .jars, as of this writing, are not available yet in any Maven repository. You can expect that to change when the next public release of the compiled sources is available. In the interim, you can build from the latest sources yourself.