java.lang.IllegalStateException in chrome driver

293 views
Skip to first unread message

prakash moorthi

unread,
Oct 24, 2017, 11:03:09 PM10/24/17
to Selenium Users
Hi all,

I just tried to invoke chrome driver in eclipse with below simple program but getting error...plz help me to resolve 

Thanks in advance

config details.

chrome -Version 62.0.3202.62 (64-bit)
java -9.0.1
eclipse -Oxygen
server /standalone -3.6.0




import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class Basic {
WebDriver driver;
public void invoke() {
try {
System.setProperty("webdriver,chrome.driver","C:\\chromedriver_win32\\chromedriver.exe");
System.out.println("hello");
driver=new ChromeDriver();
driver.get("https://www.google.co.in");
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
Basic b1=new Basic();
b1.invoke();
}

}

O/P:

hello
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:754)
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:124)
at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:32)
at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:137)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:329)
at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:123)
at com.selenium.webdriver.sample.Basic.invoke(Basic.java:13)
at com.selenium.webdriver.sample.Basic.main(Basic.java:23)

Chandrika Subramanya

unread,
Oct 24, 2017, 11:13:35 PM10/24/17
to Selenium Users
System.setProperty("webdriver,chrome.driver","C:\\chromedriver_win32\\chromedriver.exe"); -------remove , after webdriver and replace it with dot . It should work. thanks
chandrika

Parameshwari Raghavan

unread,
May 14, 2018, 11:36:18 AM5/14/18
to Selenium Users

Hi,

I have tried to run the below set of codes in eclipse and ended up with the similar exception, Please help.

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class OpenPracto
{
public static void main(String[] args) 
{
//System.setProperty("webdriver.chrome.driver","C:/Users/param/SeleniumDrivers/chromedriver.exe");
System.setProperty("webdriver.chrome.driver","D:\\SeleniumDrivers\\chromedriver.exe");
WebDriver driver=new ChromeDriver();
        System.out.println("Hello World"); 
         
}
}


Thanks,
Parameshwari
Reply all
Reply to author
Forward
0 new messages