2

I have added my chrome driver path in my system variable but still am getting the illegal exception , when i run my selenium script as :

WebDriver driver = new ChromeDriver();
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
karthick
  • 19
  • 3
  • 1
    Post your code and error stacktrace – Vishnu T S Dec 19 '17 at 06:48
  • 1
    you need to provide more information about the details such as exception and your development environment. – Kayvan Tehrani Dec 19 '17 at 06:51
  • 1
    You should set this before creating driver object System.setProperty("webdriver.chrome.driver", "path of chromedriver"); – Vishnu T S Dec 19 '17 at 06:51
  • WebDriver driver; @Test(dataProvider="MGM") public void MgmLogin(String Username,String Password) { //System.setProperty("webdriver.chrome.driver","D:\\Drivers\\chromedriver.exe" ); driver=new ChromeDriver(); error – karthick Dec 19 '17 at 06:52
  • Possible duplicate of [Unable to invoke Google browser](https://stackoverflow.com/questions/46587942/unable-to-invoke-google-browser) – undetected Selenium Dec 19 '17 at 06:52
  • 1
    error : The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html at com.google.common.base.Preconditions.checkState(Preconditions.java:754) – karthick Dec 19 '17 at 06:52
  • Did you restart your IDE after adding ChromeDriver to your path? – Marcel Dec 19 '17 at 07:39

1 Answers1

0

Seems like you have entered the wrong driver path.

Make sure to exclude the chromedriver.exe from your path variable.

enter image description here

To verify, open the Command Line (Run cmd.exe) -> Type chromedriver ->Hit Enter -> ChromeDriver

enter image description here

After setting the path make sure to restart your IDE.

Vishnu T S
  • 3,476
  • 2
  • 23
  • 39