5

My script is not running even by using selenium 2.53.1 and firefox 47.0.1. Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. is the error returned.

The script that was tried is,

package SystemPackTest; 
import org.openqa.selenium.WebDriver; 
import org.openqa.selenium.firefox.FirefoxDriver; 
public class TestCalass { 
    public static void main(String[] args) { 
        WebDriver driver ;
        System.setProperty("webdriver.gecko.driver", "<geckodriver path>");
        driver = new FirefoxDriver(); 
        driver.get("google.com"); 
        System.out.println("Successfully opened the website"); 
        //driver.close(); 
    } 
} 

Question - How to fix error, Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms?

  • 2
    Can you share your script? – IAmMilinPatel Jul 27 '16 at 8:00
  • package SystemPackTest; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; public class TestCalass { public static void main(String[] args) { WebDriver driver = new FirefoxDriver(); driver.get("google.com"); System.out.println("Successfully opened the website"); //driver.close(); } } – nazish Jul 29 '16 at 5:00
  • @Nazish, for opening url we need to give link with http:// also. // Go to URL driver.get("https://www.google.com"); And selenium 2.53.1 is not compatible for Firefox 47.0.1. (I think this two will resolve your problem) – Pavan Kumar Jul 29 '16 at 6:17
  • Latest Firefox may have now fixed this issue, please retest against latest firefox version – Michael Durrant Aug 12 '16 at 11:19
  • Pls accept most helpful answer, So this question will not be in Active state for long – NarendraC Jan 6 '17 at 13:07
2

Solution 1 -

I will suggest to downgrade (replace with older version) your ff browser version. You are unable to connect to 127.0.0.1 maybe because version do not support each other.

Upgrade or downgrade version for Selenium or FF will resolve issue.

Note - Prefer to downgrade FF version, I got success with such approach.

Solution 2 - Try running this before you start your Selenium server:

export DISPLAY=:0

DISPLAY is essentially an environment variable which needs to be exported from the command line.

  • still got the same issue even after degrade FF to 40.0 – nazish Jul 29 '16 at 4:59
  • org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output: this error occur – nazish Jul 29 '16 at 5:04
  • 1
    Understood FF Version 40.0 is also having error. Can you further degrade and try to install 38.6.0? I am using FF version 38.6.0 & Its working well with selenium 2.47.1 – NarendraC Jul 29 '16 at 6:29
  • 1
    Download FF version to 38.0.6, it worked – raslowcha Oct 11 '16 at 7:20
  • Faced the same issue. Downgraded FF to 41.0 and it worked fine!!! – user22069 Oct 24 '16 at 4:25
1

Scenarios :

  1. As per Selenium Webdriver 3.0 Documentation and Geckodriver Configuration Document,

    Selenium 3.0 and higher version require Java8 and Firefox 46,47+ versions.

Note : Here you require to use geckodriver

  1. For Selenium Webdriver 2.53.1 and Lesser version,

    Require lesser version from Firefox 45 and Java7

Note : Here only WebDriver driver = new FirefoxDriver(); will work perfectly.

Please configure system as per above combination and verify your script.

As per given comments, Answer is scenario 2.

0

In my case just now the issue was that I was passing a prepared profile dir that obviously appeared absent/invalid when I switched from MacOS to Windows node.

Yeah, it was impossible to figure this out by just reading the node/hub stderr.

Not the answer you're looking for? Browse other questions tagged or ask your own question.