0
public class TestClass1 {
    public static void main(String[] args) {
        System.setProperty("webdriver.firefox.marionette","C:\\geckodriver.exe");

        WebDriver driver = new FirefoxDriver();
        driver.get("https://accounts.google.com/signin");

        driver.close();
        System.exit(0);
    }
}

This code is results in the following:

Exception in thread "main" org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(C:\Program Files\Mozilla Firefox\firefox.exe) on port 7055; process output follows: 

      [
        {
          "id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}",
          "minVersion":"63.0","maxVersion":"63.*"
        }
      ],
      "targetPlatforms":[],
      "seen":true,
      "dependencies":[],
      "hasEmbeddedWebExtension":false,
      "userPermissions":null,
      "icons":{},
      "blocklistState":0,
      "blocklistURL":null,
      "startupData":null,
      "hidden":true,
      "location":"app-system-defaults"
    }
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352

2 Answers2

0

Try this out:

  1. Make sure that your FF version is 63 (the latest on Oct 30, 2018)
  2. Make sure your selenium version is 3.14
  3. Make sure that you have downloaded latest geckodriver 0.23 (https://github.com/mozilla/geckodriver/releases)
  4. Make sure geckodriver.exe is in the root of C:\\ (or change the path below)
  5. Use: System.setProperty("webdriver.gecko.driver", "C:\\geckodriver.exe");

If it does not work, try downgrading your FF to a previous 62 version and give it a try.

FYI read this Difference between webdriver.firefox.marionette & webdriver.gecko.driver

Supported versions: https://firefox-source-docs.mozilla.org/testing/geckodriver/geckodriver/Support.html

Vladimir Efimov
  • 797
  • 5
  • 13
  • @JerryGeorge it would be helpful for other users if you share which step helped you... or provide some more details if none of them helped ;). – Vladimir Efimov Oct 30 '18 at 12:53
0

While working with Selenium 3.x, GeckoDriver and Firefox you need to download the latest required version of GeckoDriver from mozilla/geckodriver, extract it and mention the absolute path of the GeckoDriver binary through System.setProperty() line through the Key webdriver.gecko.driver instead of webdriver.firefox.marionette as follows:

public class TestClass1 {

    public static void main(String[] args) {

    System.setProperty("webdriver.gecko.driver","C:\\path\\to\\geckodriver.exe");
    WebDriver driver = new FirefoxDriver();
    driver.get("https://accounts.google.com/signin");
    driver.quit();
    }
}

Note: Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.

Supported Platforms

The following table shows a mapping between geckodriver releases, supported versions of Firefox, and required Selenium version:

GeckoDriver_SupportedPlatforms_small

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352