I am getting Exception:
in thread "main" java.lang.IllegalStateException: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:199)
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:109)
at org.openqa.selenium.chrome.ChromeDriverService.access$0(ChromeDriverService.java:1)
at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:137)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:296)
at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:116)
at SeleniumFirefox.main(SeleniumFirefox.java:11)
Below is my code
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
public class TestDemo {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.setProperty("webdriver.chromedriver.driver",
"C://Users//balwinder//Desktop//chromedriver.exe");
WebDriver driver = new ChromeDriver();
/*try {
Thread.sleep(5000);
} catch(InterruptedException ex) {
System.out.println(ex.getMessage());
}*/
}}