Priyanshu Shekhar Priyanshu Shekhar - 2 months ago 102
Java Question

How to use geckodriver in selenium webdriver 3.0 beta?

How can I use geckodriver for selenium webdriver 3.0 beta release. When I instantiate firefox like:

WebDriver driver = new FirefoxDriver();
System.setProperty("webdriver.gecko.driver", "//lib//geckodriver");

I get 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


Got the solution:

System.setProperty("webdriver.gecko.driver", "pathTogeckodriver");
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);
WebDriver driver = new FirefoxDriver(capabilities);