web drive issue
public class drives {
public static void main(String[] args) throws InterruptedException {
System.setProperty("webdriver.Chrome.driver","E:\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("http://www.gcrit.com/build3/admin/");
Thread.sleep(5000);
driver.close();
i'm getting the while running
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:847)
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:125)
at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:35)
at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:156)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:346)
at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:91)
at org.openqa.selenium.chrome.ChromeDriver.
Mnandhu88 - Using Eclipse , I have written this. For me works with this Code. Add External JAR's without fail. You may get. Try that.
import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class Example { public static void main(String[] args) { System.setProperty("webdriver.chrome.driver", "D:\chromedriver_win32\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.get("https://google.com"); } }