0

Error:

Exception in thread "main" java.lang.IllegalStateException: The driver executable must exist

Code trials:

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class Hello {
                
    public static void main(String[] args) {            
        System.setProperty("webdriver.gecko.driver", "‪C:\\Users\\91831\\OneDrive\\Desktop\\eclipse-workspace\\geckodriver.exe");
        System.out.println("Hello");
        WebDriver driver = new FirefoxDriver();
        driver.get("http:\\www.amazon.in");
    }    
}
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Angel
  • 1
  • 1

1 Answers1

0

This error message...

Exception in thread "main" java.lang.IllegalStateException: The driver executable must exist

...implies that the WebDriver executable doesn't exists at the mentioned location.


You have mentioned:

System.setProperty("webdriver.gecko.driver", "‪C:\\Users\\91831\\OneDrive\\Desktop\\eclipse-workspace\\geckodriver.exe");

As you are using operating system, ensure that you have downloaded GeckoDriver with .zip extension from the release location, unzipped the executable binary and placed geckodriver.exe within ‪C:\\Users\\91831\\OneDrive\\Desktop\\eclipse-workspace sub-directory.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352