Exception in thread main java.lang.IllegalStateException: The driver executable does not exist | Selenium Forum
A
akshata kothiwale Posted on 03/01/2021

Hello Ashish sir, I am using Mac os , i tried all the possibilities i still keep getting this error

Exception in thread "main" java.lang.IllegalStateException: The driver executable does not exist: /Users/Aks/Downlods/Day2/geckodriver

at com.google.common.base.Preconditions.checkState(Preconditions.java:585)

at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:146)

at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:141)

at org.openqa.selenium.firefox.GeckoDriverService.access$100(GeckoDriverService.java:44)

at org.openqa.selenium.firefox.GeckoDriverService$Builder.findDefaultExecutable(GeckoDriverService.java:167)

at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:355)

at org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:190)

at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:147)

at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:125)

at SeleniumDrivers.main(SeleniumDrivers.java:10)

 

------- My code is 

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.firefox.FirefoxDriver;

 

public class SeleniumDrivers {

 

public static void main(String[] args) {

// TODO Auto-generated method stub

    

    System.setProperty("webdriver.gecko.driver","/Users/Aks/Downlods/Day2/geckodriver");

    FirefoxDriver fd1 = new FirefoxDriver();

    fd1.get("https://www.yahoo.com");

}

 

}


A
Ashish Replied on 07/01/2021

Well .. path might not be correct

Or you can add this to environment variable of your PC. This way you do not need to write this line


Related Posts