0

I am working on selenium. I am using linux os. I am using firefox driver for automated testing my app. My firefox version is 53.0.3 (64 bit). When I run the code the Firefox browser open and don't pass the URL, meanwhile getting an error.

My selenium code:

//Firefox driver

    System.setProperty("webdriver.gecko.driver","pathToGeckodriver");
    driver =new FirefoxDriver();

Console error:

java.lang.IllegalStateException: The driver executable does not exist: /home/naveen/IdeaProjects/QberTestCase/pathToGeckodriver
    at com.google.common.base.Preconditions.checkState(Preconditions.java:199)
    at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:121)
    at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:116)
    at org.openqa.selenium.firefox.GeckoDriverService.access$000(GeckoDriverService.java:37)
    at org.openqa.selenium.firefox.GeckoDriverService$Builder.findDefaultExecutable(GeckoDriverService.java:95)
    at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:296)
    at org.openqa.selenium.firefox.FirefoxDriver.createCommandExecutor(FirefoxDriver.java:277)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:247)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:242)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:238)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:127)
    at util.DriverManager.<init>(DriverManager.java:39)
    at steps.LoginSteps.<init>(LoginSteps.java:13)
    at user.userTest.initDriver(userTest.java:25)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:100)
    at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:515)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:216)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:143)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:307)
    at org.testng.SuiteRunner.run(SuiteRunner.java:270)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1284)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1209)
    at org.testng.TestNG.runSuites(TestNG.java:1124)
    at org.testng.TestNG.run(TestNG.java:1096)
    at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
    at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:127)


Test ignored.
  • Which OS is used to run above code? – Bharat Mane Jun 8 '17 at 8:52
  • you have changed your console error & it seems that: you have entered the incorrect path of your Geckodriver. – Bharat Mane Jun 8 '17 at 10:12
  • @BharatMane Linux os – user24314 Jun 8 '17 at 10:13
  • @BharatMane What should i do ? – user24314 Jun 8 '17 at 10:16
  • Confirm once your GeckoDriver Path which you have added in your code. You must have to include 'geckodriver.exe' it as like: C:/Bharat Data/Selenium Setup/geckodriver.exe – Bharat Mane Jun 8 '17 at 14:06
4

Add proper code to launch your Firefox driver using Geckodriver:

System.setProperty("webdriver.gecko.driver","path of/geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get(URL);

If your are connected with RemoteWebDriver:

System.setProperty("webdriver.gecko.driver","path of/geckodriver.exe");
DesiredCapabilities capabilities=DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);
WebDriver driver = new FirefoxDriver(capabilities);
1

Try replacing:

System.setProperty("webdriver.firefox.marionette","pathToGeckodriver");

with:

System.setProperty("webdriver.gecko.driver","pathToGeckodriver");
  • I update my question please check – user24314 Jun 8 '17 at 9:44
  • it seems that the path you are providing has issue. Can you share the path? – Rabia Asif Jun 8 '17 at 10:13
  • I'm working on linux os. I put the geckodriver in this location /home/naveen/geckodriver – user24314 Jun 8 '17 at 10:18
  • Okay see your path should be like this: C:\\Users\\abc\\Downloads\\geckodriver-v0.16.1-win64\\geckodriver.exe – Rabia Asif Jun 8 '17 at 10:20
  • I'm working on linux os – user24314 Jun 8 '17 at 10:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy