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?

6
  • 2
    Can you share your script? Commented Jul 27, 2016 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
    Commented Jul 29, 2016 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) Commented Jul 29, 2016 at 6:17
  • Latest Firefox may have now fixed this issue, please retest against latest firefox version Commented Aug 12, 2016 at 11:19
  • Pls accept most helpful answer, So this question will not be in Active state for long Commented Jan 6, 2017 at 13:07

3 Answers 3

3

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.

5
  • still got the same issue even after degrade FF to 40.0
    – nazish
    Commented Jul 29, 2016 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
    Commented Jul 29, 2016 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 Commented Jul 29, 2016 at 6:29
  • 1
    Download FF version to 38.0.6, it worked
    – raslowcha
    Commented Oct 11, 2016 at 7:20
  • Faced the same issue. Downgraded FF to 41.0 and it worked fine!!!
    – user22069
    Commented Oct 24, 2016 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.