How to set chrome browser driver system property ? Selenium Webdriver chrome driver illegal state exception.

selenium webdriver exception

How do we solve chrome browser exception which says : Illegal state Exception and is related to chrome driver. While working with Firefox, there is no such error shown. This is applicable only while trying to execute in chrome browser. It’s a simple one step addition to the code as shown below.

Chrome browser Exception:

Exception in thread “main” java.lang.IllegalStateException: The path to the driver executable must be set by the system property; for more information, see The latest version can be downloaded from

Solution :

  1. Download Chrome Driver from here.
  2. Add path (chrome driver location) to the system.set property as shown below.
  3. Execute the script.


System.setProperty(“”, “SYSTEM PATH“);

System.setProperty(“”, “C:\\chromedriver_win32\\chromedriver.exe“);


Chrome Driver exception_ Selenium webdriver

Chrome Driver exception_ Selenium webdriver