For every new class i am getting this issue , please let me know about this
package web;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Switch_Window_Commands {
public static void main(String[] args) {
FirefoxDriver fd = new FirefoxDriver();
//System.setProperty("webdriver.gecko.driver", "F:\\selenium\\selenium software\\driver browsers\\gecko driver\\latest\\geckodriver.exe");
System.setProperty("webdriver.gecko.driver", "F:\\selenium\\selenium software\\driver browsers\\gecko driver\\geckodriver.exe");
fd.navigate().to("http://toolsqa.com/automation-practice-switch-windows/");
fd.manage().window().maximize();
fd.manage().timeouts().implicitlyWait(10, TimeUnit.MICROSECONDS);
String handle = fd.getWindowHandle();
fd.switchTo().window(handle);
fd.navigate().refresh();
fd.close();
}
}
console 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
Instructor
Ashish Thakur Replied on 22/07/2019
Please make sure that driver executable is accessible. Firefox driver might not be specified properly as well.