1

can anyone help with the these errors or tell me what's causing them I added all the .JAR files that were in the file i downloaded from seleniumHQ.org but im still getting these errors:

Exception in thread "main" java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.com/mozilla/geckodriver. The latest version can be downloaded from https://github.com/mozilla/geckodriver/releases
at com.google.common.base.Preconditions.checkState(Preconditions.java:738)
at org.openqa.selenium.remote.service.DriverService.findExecutable
(DriverService.java:111)
at org.openqa.selenium.firefox.GeckoDriverService.access100ドル
(GeckoDriverService.java:38)
at org.openqa.selenium.firefox.GeckoDriverService$Builder.findDefaultExecutable
(GeckoDriverService.java:112)
at org.openqa.selenium.remote.service.DriverService$Builder.build
(DriverService.java:302)
at org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:233)
 at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:125)
 at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:121)
 at seleniumTakeTwo.testTutorialTwo.main(testTutorialTwo.java:11)
undetected Selenium
194k44 gold badges304 silver badges385 bronze badges
asked Apr 11, 2017 at 18:24
2
  • You need to have a web driver for selenium to use. The one mentioned in your error is github.com/mozilla/geckodriver/releases Commented Apr 11, 2017 at 18:26
  • Did you read the error, follow the link, and follow the instructions there? Commented Apr 11, 2017 at 21:07

1 Answer 1

1

To work with Selenium 3.x with Mozila Firefox 52.0.2 you need to:

  1. Download the latest gecko driver and save it in "C:\your_folder".
  2. Set the System property mentioning the gecko driver along with its absolute path on your system as:

System.setProperty("webdriver.gecko.driver", "C:\\your_folder\\geckodriver.exe");

  1. Next initialise the Webdriver as:

WebDriver driver = new FirefoxDriver();

  1. Maximize the browser:

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

  1. Open an url:

driver.get("http:\\gmail.com");

Let me know if this helps you.

answered Apr 11, 2017 at 18:36

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.