I am trying to launch Mozilla but still I am getting this error:
Exception in thread \"main\" java.lang.IllegalStateException: The path to the driver
Every Driver service in selenium calls the similar code(following is the firefox specific code) while creating the driver object
@Override
protected File findDefaultExecutable() {
return findExecutable(
"geckodriver", GECKO_DRIVER_EXE_PROPERTY,
"https://github.com/mozilla/geckodriver",
"https://github.com/mozilla/geckodriver/releases");
}
now for the driver that you want to use, you have to set the system property with the value of path to the driver executable.
for firefox GECKO_DRIVER_EXE_PROPERTY = "webdriver.gecko.driver" and this can be set before creating the driver object as below
System.setProperty("webdriver.gecko.driver", "./libs/geckodriver.exe");
WebDriver driver = new FirefoxDriver();