RE: FirstTestCase

Hi ,

I have created first test cases as per your instruction for everything  in toolsqa website mentioned the details & run below the code ,throwing an error.Please help me how to resolve this problem.

FirstTestCase.Java

package automationFramework;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class FirstTestCase {

public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub

WebDriver driver=new FirefoxDriver();

driver.get(“http://www.store.demoqa.com”);

System.out.println(“Successfully lanched”);

Thread.sleep(1000);

driver.close();

driver.quit();

}

}

Throwing an below 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:199)
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:109)
at org.openqa.selenium.firefox.GeckoDriverService.access$100(GeckoDriverService.java:38)
at org.openqa.selenium.firefox.GeckoDriverService$Builder.findDefaultExecutable(GeckoDriverService.java:91)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:296)
at org.openqa.selenium.firefox.FirefoxDriver.createCommandExecutor(FirefoxDriver.java:245)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:220)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:215)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:211)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:124)
at automationFramework.FirstTestCase.main(FirstTestCase.java:11)

Add Comment
2 Answers

Kindly, the answer is stated in this link

http://forumsqa.com/question/i-get-error-message-when-i-run-first-test-case-with-selenium-webdriver-exception-in-thread-main-java-lang-illegalstateexception-the-path-to-the-driver-executable-must-be-set-by-the-webd/

Default Answered on September 4, 2016.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.