Browser not invoking getting error The driver executable does not exist at path
Meta -
OS: Windows 10 64 bit
Selenium Version:
Eclipse: oxygen 3a
Java version 1.8.4 64 bit
Browser: Chrome
Chrome driver installed latest
-->
Expected Behavior - Browser should invoke and hit the given url
Actual Behavior - Below error is displayed
Exception in thread "main" java.lang.IllegalStateException: The driver executable does not exist: C:\workspace\Intro\D:\chromedriver\chromedriver.exe
at com.google.common.base.Preconditions.checkState(Preconditions.java:585)
at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:137)
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:132)
at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:35)
at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:156)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:346)
at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:91)
at org.openqa.selenium.chrome.ChromeDriver.
Steps to reproduce -
code: package pacakage1;
import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver;
public class seleniumintro {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.setProperty("webdriver.chrome.driver","D:\chromedriver\chromedriver.exe"); WebDriver driver = new ChromeDriver();
driver.get("http://google.com");
}
}
This is because you have some invisible Unicode in your chromedriver.exe filepath. Escaped, your code looks like this:
System.setProperty("webdriver.chrome.driver","\u202A\u202AC:\\dev\\tools\\selenium\\chromedriver.exe");
The \u202A character is invisible and does nothing useful here. It might have found its way into your code like this.
The Security dialog box inserts that control character in the file name field in order to ensure that the path components are interpreted in the expected manner. Unfortunately, it also means that if you try to copy the text out of the dialog box, the Unicode formatting control character comes along for a ride. Since the character is normally invisible, it can create all sorts of silent confusion.
Thanks for feedback Please let me know what steps i have to follow to make it work
Just delete the extra invisible characters. If you put your text cursor in front of the C: you should be able to delete the characters using either the backspace key or the delete key. It'll look like nothing happened when you press the button, but actually it deleted the invisible character. Remember to do it twice so you get both invisible characters.
If that's not working, just delete the whole line and retype it by hand with no copy-paste.
This is a question rather than an issue. Please send questions to the selenium user group
@GitSage Thanks its working . . . .