SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Dec 2006
    Posts
    111
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Selenium - Eclipse Java Error - Please advise !!!

    Hi All,

    I am beginner and I have successfully installed below softwares:

    JDK/JAVA
    Eclipse IDE for Java Developers (Neon Release)
    Fire Fox 48

    My first basic Script:

    package TestPackage;

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

    public class TestClass {

    public static void main(String[] args) {

    WebDriver driver = new FirefoxDriver();
    driver.get("https://www.adx.co.uk/");


    }

    }

    Error:

    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(Pr econditions.java:199)
    at org.openqa.selenium.remote.service.DriverService.f indExecutable(DriverService.java:109)
    at org.openqa.selenium.firefox.GeckoDriverService.acc ess$100(GeckoDriverService.java:38)
    at org.openqa.selenium.firefox.GeckoDriverService$Bui lder.findDefaultExecutable(GeckoDriverService.java :91)
    at org.openqa.selenium.remote.service.DriverService$B uilder.build(DriverService.java:296)
    at org.openqa.selenium.firefox.FirefoxDriver.createCo mmandExecutor(FirefoxDriver.java:245)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(F irefoxDriver.java:220)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(F irefoxDriver.java:215)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(F irefoxDriver.java:211)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(F irefoxDriver.java:124)
    at TestPackage.TestClass.main(TestClass.java:9)

  2. #2
    SQA Knight
    Join Date
    May 2006
    Location
    Playa Del Rey, California, United States
    Posts
    2,594
    Post Thanks / Like
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0
    Try manually specifying the path if you have a non-standard firefox install. My guess is you might of had firefox installed via a non-standard method or installed using a different user.

    File pathToBinary = new File("C:\path\to\firefox.exe");
    FirefoxBinary ffBinary = new FirefoxBinary(pathToBinary);
    FirefoxProfile firefoxProfile = new FirefoxProfile();
    WebDriver driver = new FirefoxDriver(ffBinary,firefoxProfile);

    java - Cannot find firefox binary in PATH. Make sure firefox is installed - Stack Overflow
    David Lai
    SDET / Consultant
    LinkedIn profile

  3. #3
    SQA Knight
    Join Date
    Jun 2008
    Posts
    2,556
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0
    Starting with FF 47 you have to use gecko driver.
    https://github.com/mozilla/geckodriver/releases


    Then initialize it something like this:
    String marionetteDriverLocation = "whateverdirectory\\geckodriver.exe";
    System.setProperty("webdriver.gecko.driver", marionetteDriverLocation); <--- the part you are missing and it is complaining about
    DesiredCapabilities capabilitiesff = DesiredCapabilities.firefox();
    capabilitiesff.setCapability("marionette", true);
    capabilitiesff.setCapability("javascriptEnabled", true);
    driver = new FirefoxDriver(capabilitiesff);

  4. #4
    Apprentice
    Join Date
    Feb 2016
    Location
    London
    Posts
    25
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    Read Gecko Driver Instructions in:

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.00%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 07:23 AM.

Copyright BetaSoft Inc.