Version compatibility between selenium-server-standalone.jar and chromedriver? - selenium

What is the version compatibility between chromedriver and selenium-server-standalone.jar?
In other words, does latest version of chromedriver work with latest version of selenium-server-standalone.jar?

The Chrome Driver itself is tied more to the version of Chrome available on the execution Node (where the browser is actually spawned and a test is ran).
If you refer to the release notes, you'll see how the driver versions map to the various releases of Chrome itself.
The practice I have in place is as follows:
I match my Selenium dependency (C#/Java language bindings) to the version of the selenium-server I run either locally or on my Grid.
When I deploy a version of my test project that upgrades the Selenium dependency, I simply upgrade all my Grid VM's to the matching version (using JSON Node config really helps here, since all I have to do is stop the service, swap the jar, and relaunch with my JSON configs).
Firefox Driver is built into Selenium, so no upgrade management there. IE Driver has (at least historically) matched the minor version number of Selenium (for example, current IE Driver is 2.48.0 while Selenium is at 2.48.2), so I typically upgrade my IE driver whenever I upgrade my Selenium version. The version of Chrome Driver I employ on any given Node will then correspond to whatever version of Chrome that particular Node has installed, though in my own case, this is typically the most recent version.
In short, it's more important to match the version of Chrome Driver to the version of Chrome under which you are testing.

To add my 2 cents, chromedriver acts as the "bridge" between Chrome and the Selenium jar, so on one side you have the protocol and interface (WebDriver) that is backward compatible and on the other you have dependency on browser's releases which isn't. So compatibility wise #tim-slifer's answer is sufficient (except that now Firefox also has a driver).
However, when consuming the selenium-server-standalone.jar, you consume a binary. So versioning wise, keeping up to date with the Selenium releases is simply to have fixes to new issues that rise with time - some of which related to the compatibility between chromedriver and Chrome.
So yes and no, there is some compatibility between the 2, although an old jar and bindings can work just fine with new browsers.

Related

How to find the web browser version without setup() method using WebDriverManager

I am interested in getting the browser Version
I've two questions-
Question 1:- is there is a way to find out the browser version without setting up the browser?
or can we force stop the downloading of the Driver in the first place.
It is possible with the below code but the driver will be downloaded in this case.
WebDriverManager.chromedriver().setup(); //without doing this step
WebDriverManager.chromedriver().getDownloadedDriverVersion();
Question 2:-
Currently I am using wmic commands for browser detection which is used in WebDriverManager but it is failing on some systems.
what more alternatives ways are used in the WebDriverManager to fetch the browser version. I am curious to know about this as I've disabled wmic on my system still webDriverManager is working as usual(I guess with alternative methods within WebDriverManager).I am facing difficulties in understand the code. Please help me to understand the flow of the WebDriverManager like which methods/ways are used to detect the browser version and in what order.
Any help would be appreciated!
WebDriverManager
WebDriverManager is the open-source Java library that maintains the configuration management of the drivers required by Selenium WebDriver (e.g., chromedriver, geckodriver, msedgedriver, etc.) in a fully automated fashion.
Additionally, WebDriverManager provides other relevant features, such as the capability to discover browsers installed in the local system, building WebDriver objects (such as ChromeDriver, FirefoxDriver, EdgeDriver, etc.), and running browsers in Docker containers seamlessly.
The primary use of WebDriverManager is the automation of driver management (i.e., download, setup, and maintenance) of the drivers involved in your Test Automation Suite. Hence using WebDriverManager it's highly unlikely you can force stop the downloading of the Driver in the first place.
However, when you use a specific browser version for the first time in a while the matched driver version is downloaded and saved within the cache which is pretty much evident from the generated logs.
====== WebDriver manager ======
Current google-chrome version is 98.0.4758
Get LATEST chromedriver version for 98.0.4758 google-chrome
There is no [win32] chromedriver for browser in cache
Trying to download new driver from https://chromedriver.storage.googleapis.com/98.0.4758.102/chromedriver_win32.zip
Driver has been saved in cache [C:\Users\Sadanand.Kolhe\.wdm\drivers\chromedriver\win32\98.0.4758.102]
Moving forward, if the browser version and the matched driver version remains unchanged and at the same time the previous version of the downloaded version of the driver is available within the cache, the fresh downloading is avoided, which is evident from the logs generated from two back to back test execution.
====== WebDriver manager ======
Current google-chrome version is 98.0.4758
Get LATEST chromedriver version for 98.0.4758 google-chrome
Driver [C:\Users\Sadanand.Kolhe\.wdm\drivers\chromedriver\win32\98.0.4758.102\chromedriver.exe] found in cache
Regarding Q1, as of version 5, WebDriverManager allows detecting if a given browser is installed or not in the local system. To this aim, each manager provides the method getBrowserPath(). This method returns an Optional<Path>, which is empty if a given browser is not installed in the system or the browser path (within the optional object) when detected. See doc.
Regarding Q2, WebDriverManager uses internally a knowledge database called commands database. This database is a collection of shell commands used to discover the version of a given browser in the different operating systems (e.g., google-chrome --version for Chrome in Linux). This database contains WMIC commands for Windows but also queries to the registry. See doc again.

Why is chromedriver tied to chrome version?

I'm starting to use selenium and ChromeDriver in order to automate tasks in Chrome. I'm interested in scaling the task across multiple managed windows PC's.
I understand that updates of Chrome might break functionality in ChromeDriver. But I'm concerned it's the right tool because manually updating based on the chrome version results in a lot of maintenance as we'd have to manually place the executable on each system.
Is ChromeDriver really "whitelisting" with which chrome version it works? and why is that?
Browsers would have updates, which the driver also must have in order to invoke and interact with the browser, and hence your driver version must be in sync with the browser version. It is not just for Chrome, but for Firefox, and Edge also. One thing you can do is to use the ChromeDriverManager by installing the webdriver-manager library.
In Python, you do like this:
pip install webdriver-manager
In the py file, you can invoke the chromedriver:
from webdriver_manager import ChromeDriverManager
Then, when you initialize the driver, you can pass in the ChromeDriverManager:
driver = webdriver.Chrome(ChromeDriverManager().install())
With this, your driver and browser would be in sync. You need not worry about the incompatibility of driver-browser versions.
Please note: you would get a depcration warning with the above driver line of code, for which you need to include Service object; however, for now, it is a warning and not an error, so your code would not hamper the execution, but sooner or later, you must use Service object.
Here is a good article you can refer to Medium

How to update Chromedriver version in PyCharm for selenium-robotframework

I am using PyCharm to run my robot framework-selenium scripts.
I am facing an issue
SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 91 Current browser version is 93.0.4577.63 with binary path
Attached are my settings.
How to upgrade chromedriver for Chrome version 93 or any other suggestion. I have 75 automation scripts and it is not feasible to add driver = chrome path in all the scripts.
Browser drivers
The general approach to install a browser driver is downloading a right driver, such as chromedriver for Chrome, and placing it into a directory that is in PATH
Drivers for different browsers can be found via Selenium documentation or by using your favorite search engine with a search term like selenium chrome browser driver. New browser driver versions are released to support features in new browsers, fix bug, or otherwise, and you need to keep an eye on them to know when to update drivers you use.
Alternatively, you can use a tool called WebdriverManagerwhich can find the latest version or when required, any version of appropriate webdrivers for you and then download and link/copy it into right location. Tool can run on all major operating systems and supports downloading of Chrome, Firefox, Opera & Edge webdrivers.
Here's an example:
pip install webdrivermanager
webdrivermanager firefox chrome --linkpath /usr/local/bin
Please go through, here, everything is documented here.

which selenium jar is compatible with Mozilla Firefox version 59.0.2 (32-bit)

Previously I was using Selenium version 2.53 with Firefox version 40.0.1. But now Firefox is updated and I am trying to do with updated version.
So, respond me about "which Selenium JAR is compatible with Mozilla Firefox version 59.0.2 (32-bit)"
As per best practices you must adopt any one from the below mentioned configurations:

What are the benefits of using Marionette FirefoxDriver instead of the old Selenium FirefoxDriver for a Selenium tester?

Last weeks there has been a lot of noise about this new FirefoxDriver called Marionette. To use Firefox with Selenium, we used to use the "old" Selenium FirefoxDriver. From Firefox 48.0 onwards it is going to be required to use this new FirefoxDriver developed by Mozilla.
I understand it is required to change to that direction to get every browser supports and develops its drivers and to get drivers independent of Selenium. Besides, it is supposed if Mozilla develops its own driver, it will be faster and easier to fix issues and to develop features.
My question is, for those who create automated tests using Selenium framework, is there any benefit of using Marionette instead of the "old" Selenium supported FirefoxDriver? _(Such as a better performance, a better compatibility...)
The main advantage for using the Mozilla-provided, Marionette-based Geckodriver solution is that it works for versions of Firefox 48 and higher. The legacy driver provided and maintained by the Selenium project doesn't work for Firefox 48 or higher, and will never work for those versions of Firefox.
The legacy driver is implemented as a Firefox extension. This extension is installed in the profile used by the driver when WebDriver launches Firefox. Firefox 48 introduced two new features that disabled this browser extension. The first is the so-called "electrolysis" feature, or multiprocess Firefox. Electrolysis changes the way extensions have to deal with the browser in ways the Selenium team has not taken the time to fully understand.
The second, more important requirement is that all browser extensions must be signed by Mozilla before the browser will allow them to load. This latter feature has been in Firefox for several versions, but beginning with 48, it can no longer be disabled. The WebDriver browser extension introduces several valid security concerns for the Firefox browser, and as such, will not be signed by Mozilla's security team. This, in turn, renders the extension inoperable, and thus Selenium can no longer communicate with Firefox. The Marionette-based solution, being developed and maintained by Mozilla in the first place, is blessed by them for use in automating Firefox, and as such carries a commitment that it will continue to work with future versions moving forward.
So the primary benefit of using Marionette with Firefox 48 and higher is that it will work, whereas other solutions won't.