Exception in thread "main" java.lang.IllegalStateException

0 votes

hi

I am trying selenium first program launching chrome driver. Here is my code I am getting this error once I run it.

package samplefacebook;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

public class fbSample {

public static void main(String[] args) {

WebDriver driver = new ChromeDriver();

System.setProperty("webdriver.chrome.driver", "C:\\Users\\prasa\\Downloads\\chromedriver_win32.exe");

driver.get("https://www.facebook.com");

driver.manage().window().maximize(); 

}

}


here is the error 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$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:296)

at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88)

at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:120)

at samplefacebook.fbSample.main(fbSample.java:11)

pls solve this issue.

Thanks

Apr 12 in Selenium by prasanthi
• 120 points
75 views

1 answer to this question.

0 votes
answered Apr 13 by Sirajul
• 53,080 points

Related Questions In Selenium

0 votes
0 answers
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,510 points
2,611 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,870 points
2,055 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,870 points
2,164 views
+1 vote
1 answer

Exception in thread "main" java.lang.IllegalStateException

Your query is similar to the following ...READ MORE

answered Mar 17 in Selenium by Sirajul
• 53,080 points
403 views
+2 votes
1 answer

Error occurred during initialization of boot layer java.lang.module.FindException: Module Selenium not found

This might probably be coz while creating ...READ MORE

answered Nov 27, 2019 in Selenium by Sirajul
• 53,080 points
4,414 views