Remember the hassle of manually downloading and managing different WebDriver binaries for each browser? The Evolution of Selenium Driver addressed this long-standing challenge of Developers and Testers faced, the manual management of browser drivers.
In older versions of selenium (Selenium 3) you must set up or download the relevant web driver for your preferred browser, for example ChromeDriver for Chrome, GeckoDriver for Firefox, etc., and place it in the PATH or export the driver path as a system property. Remember the code?
But it’s quite a challenge for the selenium users to manage the browser driver manually, because some browsers update automatically though that’s an advantage but for testing purposes it breaks our test script and fails the test. For example, when your local Chrome browser updates to a newer version 115, and you encounter an incompatibility error with a manually downloaded driver for an older version (Chrome version 113)
What’s the Solution?
Manually update the latest ChromeDriver(115) and replace the old driver(113), run your test again to check everything works as expected.
Incorporate the WebDriverManager library(Bonigarcia) in your project. This library automatically checks for the browser version and downloads the matching WebDriver binary if necessary.
Big relief with WebDriverManager by Bonigarcia! It automatically handles the download and setup of webdriver binaries. We need to add the dependency in our pom.xml and a simple code
Inspired by the Open Source Libraries and the Selenium Community, Selenium people Introduced the built-in Selenium Manager in the Selenium 4.6.0 update.
What is Selenium Manager?
Selenium Manager is a CLI (Command-Line Interface) tool developed in Rust to allow cross platform execution. With the introduction of Selenium Manager in Selenium 4.6.0, you can leverage this built-in tool to automatically manage your WebDriver binaries. The code is so easy.
In addition to the stable browser version, Selenium Manager also allows downloading older browser versions, Lock Browser Versions for Critical Tests For critical test environments or specific testing phases, consider locking the browser version to ensure stability. This approach requires manual updates but can be beneficial for maintaining a consistent testing environment where utmost reliability is needed.
As of Selenium 4.11.0 Selenium Manager also implements automated browser management, Selenium Manager automatically discovers, downloads, and caches the drivers required by Selenium when these drivers are unavailable
Benefits of Using Selenium Manager
Automatic Driver Management
Simplified Setup Process
Enhanced Test Reliability
Flexibility in Testing Across Browser Versions
Reduced Maintenance Overhead
With this evolution of Selenium Driver Managers, we say Goodbye to manual setups and ensures that our testing environment is always up-to-date reduces the risk of encountering compatibility issues. Effortlessly manages the downloading and handling of browser drivers, smooth and seamless automation testing.
Hope this will help to understand the basic of Selenium Manager. Happy Reading! Thanks!!