HELP NEEDED IN THIS ERROR: Exception in thread "main" java.lang.IllegalStateException: The driver executable does not exist: C:\Program Files\selenium\chromedriver_win32\chromedriver.exe

606 views
Skip to first unread message

Irzam Latif

unread,
Apr 15, 2020, 9:51:41 AM4/15/20
to Selenium Users
I've got this error:
Exception in thread "main" java.lang.IllegalStateException: The driver executable does not exist: C:\Program Files\selenium\chromedriver_win32\chromedriver.exe
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.chrome.ChromeDriverService.access$000(ChromeDriverService.java:35)
at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:159)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:355)
at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:94)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:123)
at runDriver.Fileupload.main(Fileupload.java:15)




And i've web driver in C:\Program Files\selenium\chromedriver_win32\chromedriver.exe
any kinda help would be highly appreciated

 my code is as given below:


package runDriver;

import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;

public class Fileupload {

public static void main(String[] args) {
//Setting system properties of ChromeDriver
System.setProperty("webdriver.chrome.driver", "C:\\Program Files\\selenium\\chromedriver_win32\\chromedriver.exe");
//Creating an object of ChromeDriver
WebDriver driver = new ChromeDriver();
driver.manage().window().maximize();
//Deleting all the cookies
driver.manage().deleteAllCookies();
//Specifying pageLoadTimeout and Implicit wait
driver.manage().timeouts().pageLoadTimeout(40, TimeUnit.SECONDS);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
//launching the specified URL
driver.get("https://www.google.com/");
driver.findElement(By.name("q")).sendKeys("YouTube");
WebElement searchIcon = driver.findElement(By.name("btnK"));
searchIcon.click();
}

usman karim

unread,
Apr 15, 2020, 9:59:24 AM4/15/20
to seleniu...@googlegroups.com
You need to map your driver again

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/23b751c1-b3fc-4d85-9dca-84a924810d0e%40googlegroups.com.

Sahil Goyal

unread,
Apr 15, 2020, 10:01:09 AM4/15/20
to Selenium Users
One suggestion I would like to give is to move your driver files within your source code as the driver path shouldn't be OS dependent.

Irzam Latif

unread,
Apr 15, 2020, 12:06:03 PM4/15/20
to Selenium Users
Thankyou for your prompt response i got my chrome browser version and download the chromeDriver specific to that version n remap the driver. It works fine now. 
To unsubscribe from this group and stop receiving emails from it, send an email to seleniu...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages