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 Answer(s)

    Hi vmvenkateshmca,

    Kindly, check your firefox browser verrsion. Marionette support is best in Firefox 48 and onwards, although the more recent the Firefox version, the more bug fixes and features. Firefox 47 is explicitly not supported. And also check your selenium version If your version is 3.0.0-beta2, change them to 2.53.1 then this code will work perfectly.

    Default Answered on August 30, 2016.
    Add Comment

    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.