.

ISSUE : RESOLVED - Error while initializing FirefoxDriver | java.lang.IllegalStateException


Error :  Exception in thread "main" java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.com/mozilla/geckodriver. The latest version can be downloaded from https://github.com/mozilla/geckodriver/releases
    at com.google.common.base.Preconditions.checkState(Preconditions.java:199)
    at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:109)
    at org.openqa.selenium.firefox.GeckoDriverService.access$100(GeckoDriverService.java:38)
    at org.openqa.selenium.firefox.GeckoDriverService$Builder.findDefaultExecutable(GeckoDriverService.java:91)
    at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:296)
    at org.openqa.selenium.firefox.FirefoxDriver.createCommandExecutor(FirefoxDriver.java:244)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:219)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:214)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:210)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:123)
    at driverInvocation.FirefoxDriverX.main(FirefoxDriverX.java:14)


Selenium version : Selenium 3 Beta



Solution : 

Use it like this instead.

System.setProperty("webdriver.gecko.driver","C:\\Work\\WORK\\Selenium\\geckodriver.exe");
        DesiredCapabilities capabilities = DesiredCapabilities.firefox();
        capabilities.setCapability("marionette", true);
        WebDriver driver = new FirefoxDriver(capabilities);
        driver.get("http://www.google.com");
    }



3 comments :

  1. hi jiiee.. i have one given codee..where is firefox driver ..suppose tis code i run in ide which browser wil openn.. FF ah...Today fully i searched tis issue...i am using FF 48 and selenium 3.0 beta.....

    ReplyDelete
    Replies
    1. @Manickam, please post your code and describe the exact issue you are facing..

      Delete
  2. I am getting org.openqa.selenium.ElementNotVisibleException when i am trying to interact with the browser. The launching of browser is fine but when i want to do some operation(Say click or something i am getting ElementNotVisibleException, why ? but the id of my element is correct.)

    ReplyDelete

Recent Posts