1

I'm getting this error message while trying to initiate the Firefox browser:

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output: s":[],"hasEmbeddedWebExtension":false}

I am using selenium 3.3.1 and firefox 52.

aUserHimself
  • 1,589
  • 2
  • 17
  • 26
Parveen
  • 31
  • 1
  • 9

3 Answers3

0

I'd check your driver e.g. geckodriver is compatible with the installed version of Firefox.

There is a similar question here that might help you: Unable to connect to Firefox

Community
  • 1
  • 1
Jpc133
  • 28
  • 1
  • 4
  • Do I need to use GeckoDriver? – Parveen Apr 20 '17 at 10:15
  • You need to use a driver to bridge selenium to a browser, in Firefoxs case this a driver called geckodriver you can get it [here](https://github.com/mozilla/geckodriver/releases). Make sure your using selenium 3.3.1 as well when using gecko driver. – Jpc133 Apr 20 '17 at 13:16
  • I'm using gecko version - v0.15 – Parveen Apr 20 '17 at 13:21
  • Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output: 65 addons.xpi DEBUG Calling bootstrap method startup on aushelper@mozilla.org version 2.0 – Parveen Apr 20 '17 at 13:21
  • Can you add your code you use to initialise the driver to your question? – Jpc133 Apr 20 '17 at 13:27
  • 1
    System.setProperty("webdriver.gecko.driver","C:\\Gecko\\geckodriver.exe"); WebDriver driver = new FirefoxDriver(); driver.get("http://www.bbc.co.uk/"); System.out.println("successfully opened the website"); Thread.sleep(5); driver.quit(); – Parveen Apr 20 '17 at 13:29
  • [This](http://stackoverflow.com/questions/37785686/how-to-use-the-gecko-executable-with-selenium) question has a good answer that may help you, you may need to set the desired capabilities. – Jpc133 Apr 20 '17 at 14:04
0

Try by putting path for Gecko Driver System.setProperty("webdriver.gecko.driver", "<geckodriver path>")

xyz
  • 326
  • 1
  • 12
0

You would need to use GeckoDriver for Firefox. This was not needed for the older versions of Selenium 2.x, but it's required with Selenium 3.x

You would need to download GeckoDriver based on if your FF browser is 32-bit or 64-bit. You would also need to provide GeckoDriver and FirefoxBirnary path. Sample code that you can use to launch browser -

System.setProperty("webdriver.gecko.driver","D:\\Firefox\\geckodriver.exe");

FirefoxOptions options = new FirefoxOptions();
options.setBinary("C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe"); //This is the location where you have installed Firefox on your machine

FirefoxDriver driver = new FirefoxDriver(options);
driver.get("http://www.google.com");

You can check this link for more info - http://www.automationtestinghub.com/selenium-3-0-launch-firefox-with-geckodriver/

Anish Pillai
  • 1,023
  • 7
  • 8
  • 1
    Thanks @Anish Pillai. I tried following the steps and set up gecko but now still facing the issue unfortunately. org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output: webNavigation","webRequest"]}} – Parveen Apr 20 '17 at 13:02
  • And also when firefox browser is launched, there are two tabs open and on second tab I can see 'Skype' website launch. – Parveen Apr 20 '17 at 13:03