-1

I just installed Selenium WebDriver. When I run, I got the following exception. Can anyone help me how to fix it Please?

Exception in thread "main" java.lang.IllegalStateException:

The driver executable does not exist: C:\Users\Owner\workspace\Second Time Jave Project\path of\geckodriver.exe at com.google.common.base.Preconditions.checkState(Preconditions.java:199) at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:121) at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:116) at org.openqa.selenium.firefox.GeckoDriverService.access$000(GeckoDriverService.java:37) at org.openqa.selenium.firefox.GeckoDriverService$Builder.findDefaultExecutable(GeckoDriverService.java:95) at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:296) at org.openqa.selenium.firefox.FirefoxDriver.createCommandExecutor(FirefoxDriver.java:277) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:247) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:242) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:135) at secondTimePackage.NewJavaClass.main(NewJavaClass.java:17)

clearlight
  • 12,255
  • 11
  • 57
  • 75
zincznc7
  • 1
  • 1
  • Possible duplicate of [Firefox browser is not opening with selenium webbrowser code](http://stackoverflow.com/questions/38751525/firefox-browser-is-not-opening-with-selenium-webbrowser-code) – clearlight Jan 13 '17 at 06:16

2 Answers2

0

Have you installed your web driver? Once you do, you'll need to set your system property:

System.setProperty("webdriver.gecko.driver", "[your file path to your web driver here]");

before you call your new Firefox Driver.

Looks like you're having the a similar problem to this question: Firefox browser is not opening with selenium webbrowser code

Community
  • 1
  • 1
tp bc
  • 1
0

first check the driver version should be updated with the selenium version then The easiest way to upload the files instead calling the path from ur pc

{ string path=System.getProperty("user.dir")+"\sources\chromedriver.exe";

   System.setProperty("webdriver.chrome.driver",path);

  ChromeDriver  driver= new ChromeDriver(); 

}