Say GoodBye to Driver.exe !!

Say GoodBye to Driver.exe !!

As we all know, while using Selenium WebDriver for each browser such as Chrome, Firefox, MS Edge or IE, we need to first separately download its binary file which allows, WebDriver to handle browsers then we need to provide the absolute path of this binary in the system properties to launch the respective browsers.

It is actually quite frustrating as we need to manually check for a different version, install and use this binary files in our automation scripts.

WebDriver Manager is a solution to all these problems. WebDriver Manager allows us to:
ü  It checks the version of the browser installed in your machine (e.g. Chrome, Firefox).
ü  It checks the version of the driver (e.g. chrome driver, geckodriver). If unknown, it uses the latest version of the driver.
ü  It downloads the WebDriver binary if it is not present on the WebDriverManager cache (~/.m2/repository/webdriver by default).
ü  It exports the proper WebDriver Java environment variables required by Selenium (not done when using WebDriverManager from the CLI or as a Server)

To Know more about WebDriver Manager. Please click on this link.

To use WebDriver Manager we need to download its maven dependency by using this link.

In this blog for demo purposes, I am using below maven dependency.

Now in our automation script instead of writing the below line of code
System.setProperty("", "/absolute/path/to/binary/chromedriver");

System.setProperty("webdriver.gecko.driver", "/absolute/path/to/binary/geckodriver");

We can use below code to launch chrome browser

Below code to launch FireFox browser

Full Code would be something like:



My Name is Ankur Jain and I am currently working as Automation Test Architect.I am ISTQB Certified Test Manager,Certified UI Path RPA Developer as well as Certified Scrum Master with total 12 years of working experience with lot of big banking clients around the globe.I love to Design Automation Testing Frameworks with Selenium,Appium,Protractor,Cucumber,Rest-Assured, Katalon Studio and currently exploring lot in Dev-OPS as well. I am currently staying in Mumbai, Maharashtra. Please Connect with me through Contact Us page of this website.

Previous Post
Next Post
April 16, 2019 at 8:01 AM

I got this error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at io.github.bonigarcia.wdm.WebDriverManager.(
at test.TestDriverManager.main(
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
... 2 more

I using the same WebDriverManager version and the run the same Full Code

April 16, 2019 at 8:39 AM

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See for further details.
I got this issue:
Apr 16, 2019 10:04:54 AM java.util.prefs.WindowsPreferences
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.

April 24, 2019 at 11:20 AM

we are getting error:
Exception in thread "main" java.lang.NoSuchMethodError:;Ljava/nio/charset/Charset;)Ljava/lang/String;

Do we need to add any dependency in pom.xml apart from webdrivermanager dependency ?

April 24, 2019 at 11:22 AM

Hi Ankura,

We are getting error:
Exception in thread "main" java.lang.NoSuchMethodError:;Ljava/nio/charset/Charset;)Ljava/lang/String;

Do we need to add any dependency in pom.xml apart from webdrivermanager dependency ?

May 24, 2019 at 6:11 PM

Hi Ankur jain,
What is your approach to resolve if the multiple builds fail and jenkins slave is not responding like take longer time for execution than required?

June 29, 2019 at 10:43 PM

it is seriously not working. I am really impressed by your other blogs but not this one.

June 30, 2019 at 9:12 AM

Hi Abhishek ,Can you please share exact error message screenshot,code and issue you are facing while implementing this on my email id

Till now lot of people have implemented this without any issue and the issue that might have reported out is due to other incorrect dependencies in their pom.xml.

Happy to help you out in case of any issue..

January 9, 2021 at 10:43 PM

Hi Ankur,
Can you please help with below issue.

I have added dependencies in pom.xml


And below is the code to initiate browser
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.edge.EdgeDriver;
import io.github.bonigarcia.wdm.WebDriverManager;

public class WebDriverManagerPractice {
//static WebDriver driver;

public static void main(String[] args) {
//WebDriver driver = new ChromeDriver();
WebDriver driver = new EdgeDriver();

Exception in thread "main" java.lang.NoSuchMethodError:;Ljava/nio/charset/Charset;)Ljava/lang/String;
at io.github.bonigarcia.wdm.versions.Shell.runAndWaitNoLog(
at io.github.bonigarcia.wdm.versions.Shell.runAndWaitArray(
at io.github.bonigarcia.wdm.versions.Shell.runAndWait(
at io.github.bonigarcia.wdm.versions.VersionDetector.getBrowserVersionInWindows(
at io.github.bonigarcia.wdm.versions.VersionDetector.getDefaultBrowserVersion(
at io.github.bonigarcia.wdm.managers.EdgeDriverManager.getBrowserVersionFromTheShell(
at io.github.bonigarcia.wdm.WebDriverManager.detectBrowserVersion(
at io.github.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(
at io.github.bonigarcia.wdm.WebDriverManager.manage(
at io.github.bonigarcia.wdm.WebDriverManager.setup(
at sellinumPractice.WebDriverManagerPractice.main(