Monday 1 September 2014

Exception in thread "main" java.lang.IllegalStateException

When executing a selenium script written in java to use IE/Chrome driver, an exception would have been thrown to check System.setProperty. The code below seems to be exactly right but 'webdriver' is coded as 'Webdriver' in the first argument, and there stands the exception.

File file = new File("G:\\Data\\git\\Test\\lib\\IEDriverServer.exe");
System.setProperty("Webdriver.ie.driver", file.getAbsolutePath());
WebDriver driver = new InternetExplorerDriver();


Exception in thread "main" java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see http://code.google.com/p/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://selenium-release.storage.googleapis.com/index.html