Error in launching google Chrome browser without System.setProperty() command | Selenium Forum
S
SMITA KURARIA Posted on 12/02/2020

I just want to launch chrome browser without System.setProperty cmd ….. I did setup drivers path in env variable too and restarted system. However when I am running code to launch chrome browser without using System.setProperty cmd its giving me error Exception in thread "main" java.lang.IllegalStateException:

 

Any Thought ?

Code

public class LaunchBrowser {
public static void main (String[] args)throws InterruptedException{

// System.setProperty("webdriver.chrome.driver", "C:\\smita docs\\selenim 0128\\Drivers\\chromedriver_win32 (1)\\chromedriver.exe");
ChromeDriver driver = new ChromeDriver();
driver.get("https://google.com");
System.out.println(driver.getTitle());

}

Error :-

Exception in thread "main" java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property;

 


A
Ashish Thakur Replied on 13/02/2020

Please make sure that the path variable is set to the below path.

"C:\\smita docs\\selenim 0128\\Drivers\\chromedriver_win32 (1)\\


Related Posts