swathi
swathi

Reputation: 1

I am getting the following exception while launching face book using chrome browser in Selenium can any one suggest me the solution for this

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.(ChromeDriver.java:116) at New.HelloWorld.main(HelloWorld.java:16)

Upvotes: 0

Views: 850

Answers (1)

Pankaj Kumar Katiyar
Pankaj Kumar Katiyar

Reputation: 1494

You need to use this code to set the location of chromedriver before initializing the driver. Use the method setProperty(String key, String path):

System.setProperty("webdriver.chrome.driver", "/tpt/chromedriver.exe");

Upvotes: 0

Related Questions