1

while I am running a selenium webdriver program I got an error named "org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output".

What is this error..?

Agil C
  • 71
  • 1
  • 8
  • 1
    What is the version of your selenium and Firefox as well?? – Saurabh Gaur Aug 06 '16 at 09:11
  • Selenium 3.1 beta ang Firefox 48 – Agil C Aug 08 '16 at 03:43
  • Then what is the problem with below with purendra answer...?? – Saurabh Gaur Aug 08 '16 at 04:00
  • It's not working, don't know why. Showing the same error – Agil C Aug 08 '16 at 04:33
  • Share your tried code... – Saurabh Gaur Aug 08 '16 at 04:48
  • System.setProperty("webdriver.gecko.driver","/home/agil/Documents/geckodriver"); new DefaultSelenium(nodeIp,ffPortId, "*firefox",browserUrl); DesiredCapabilities capabilities = DesiredCapabilities.firefox(); capabilities.setCapability("marionette", true); driver = new FirefoxDriver(capabilities); driver.get("www.google.com"); – Agil C Aug 08 '16 at 04:51
  • Are you in using remote selenium server standalone??? and are you in mac??why are you using `DefaultSelenium`?? – Saurabh Gaur Aug 08 '16 at 05:03
  • No, I'm not using remote selenium server. I'm using ubuntu. Default selenium is used for getting the URL and port. Acutually this code was implemented with Selenium Grid and I'm converting it to Webdriver. – Agil C Aug 08 '16 at 05:08
  • Omit this line `new DefaultSelenium(nodeIp,ffPortId, "*firefox",browserUrl);`..try as : `System.setProperty("webdriver.gecko.driver","/home/agil/Documents/geckodriver"); DesiredCapabilities capabilities = DesiredCapabilities.firefox(); capabilities.setCapability("marionette", true);WebDriver driver = new FirefoxDriver(capabilities); driver.get("www.google.com");` – Saurabh Gaur Aug 08 '16 at 05:12
  • It's not working either. Getting the same error. – Agil C Aug 08 '16 at 05:17

2 Answers2

1

do you have skype, teamviewer? you must disable it or un-install it because other apps use the port that the server your using . I mean the port use by your server use already by the other apps ..

gideon
  • 23
  • 2
  • on I'm not installed skype or teamviewer. I'm using ubuntu, and have only selenium related Softwares. – Agil C Aug 06 '16 at 09:41
  • get your private IP address given by your router should be something like this 192.168.1.10 open / etc/mysql/mysql.cnf change bind-address = 192.168.1.10 and restart your server .. (sudo server mysql restart) – gideon Aug 08 '16 at 05:06
1

You can try this once :

Download the gecko driver from here as per the requirements.

Then Write the code in Selenium under the main method:

System.setProperty("webdriver.gecko.driver",
"path you downloaded/geckodriver.exe");
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);
WebDriver driver = new FirefoxDriver(capabilities);
driver.get("www.google.com");

I think this might help you because there was an issue with the updated version of firefox.

Purendra Agrawal
  • 558
  • 1
  • 6
  • 17