How to fix the "No drivers have been configured or have been found on PATH" error?

8.3k Views Asked by At

I would like to run Selenium server standalone 4 on my server. But as I try to run java -jar selenium-server-4-beta-2.jar standalone it throws me an error:

No drivers have been configured or have been found on PATH

I don't understand what to do it. I have an actual driver file in the same directory as the jar file.

Can somebody tell me please what it means?

9

There are 9 best solutions below

5
Sonali Das On BEST ANSWER

have you set the chrome driver path. you may want to set that

System.setProperty("webdriver.chrome.driver","Your Chrome driver locaton");
WebDriver driver =new ChromeDriver();
0
vijay atm On

Try using WebDriverManager, you don't need to give a path/update the drivers ever.

WebDriverManager.chromedriver().setup();
WebDriver driver = new ChromeDriver();

Source:

https://mvnrepository.com/artifact/io.github.bonigarcia/webdrivermanager

1
Eyal Sooliman On

You can also download the chromedriver directly from here: https://chromedriver.chromium.org/downloads

and the set the "path" variable with the location of the chromedriver:

enter image description here

Then run the commend:

java -jar selenium-server-4.0.0.jar standalone
0
beifeng107 On

I have added the driver directory to PATH, but it throws the error, too.
Finally I changed the filename of each driver, then it works OK.
For example:
change "chromedriver_79.0.3945.36.exe" to "chromedriver.exe".

0
Shahzaib On

I simply moved my chromedriver file next to selenium-server-4.0.0.jar file and ran this command again and it worked

0
Baskar Balan On

Please follow the below steps to sort our the problem

  1. Add the Environment Variable (Environment Variable--> system variable--> Path-->Add the driver path)
  2. Restart the machine
0
pawelwaw On

Install the Gecko driver or Chrome driver and then add that Path in your operating system

0
kumar On

Same issue for me. Setting up the driver path didn't work for me. Quick Fix: Copy Drivers(Ex: chromedriver.exe) to the .jar file folder. Then try to run the command again. It works fine

0
samir varude On

My issue got resolved with below mentioned steps 1 Copy driver and paste it in same folder where your jar placed 2. Add Driver location in PATH variable of environment variables