java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property

Assuming the chromedriver.exe is stored at your desktop, you need to make a couple of changes as follows:

  • You need to replace the uppercase W with lower case w within Webdriver.chrome.driver.
  • As you are on system, presuming chromedriver.exe is placed in your desktop ypu need to append the WebDriver variant name along with the extension within the absolute path of the WebDriver.
  • Effectively the line of code will be:

    System.setProperty("webdriver.chrome.driver", "C:\\Users\\sravani\\Desktop\\chromedriver.exe");
    

Note: webdriver.chrome.driver needs to start with lowercase letter.

Leave a Comment