2

I'm using Selenium for my functional testing, but I just had a bug I can't resolve. It was working well all this month but since the last run of the test, any Firefox browser that i run with my test just give me the error "Firefox stopped working".

So far I've read different post related to this problem, they say reinstall selenium or Firefox fixed it, but I tried both and it failed. By reinstall Selenium I mean just remove and read the library in my project.

Here an example of the code that give me the error :

public class Test {
    static WebDriver driver;
    static Wait<WebDriver> wait;
    public static void main(String[] args) {
        driver = new FirefoxDriver();//true to enable the JS
        wait = new WebDriverWait(driver, 3000);
        final String url = "https://www.google.com";

        JavascriptExecutor js = (JavascriptExecutor) driver;

        try {
            driver.navigate().to(url);


        } finally  {
            driver.close();
        }

    }
}

THis provide the following error :

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:

halfer
  • 19,824
  • 17
  • 99
  • 186
Omegaspard
  • 1,828
  • 2
  • 24
  • 52
  • The code seems fine. I would suggest using driver.quit() instead of driver.close() though. Otherwise the driver will stay alive until it times out. – RemcoW Jun 10 '16 at 12:23
  • yeah the code is very simple, i don't think it comes from it i put it just as a convention. Do you have any idea for my problem ? – Omegaspard Jun 10 '16 at 12:25
  • Apart form completely uninstalling firefox en selenium and reinstalling it afterwards I have no clue what could fix it, sorry. – RemcoW Jun 10 '16 at 12:40
  • what do you mean by completely reinstalling selenium ? because it's just a jar that i add to my project on eclipse, is there another way ? – Omegaspard Jun 10 '16 at 12:45
  • Deleting everything of selenium on your machine. The standalone server, the libraries you use in your application and reinstall it afterwards. – RemcoW Jun 10 '16 at 12:48
  • Ok, just to be sure. By reinstalling you mean just adding the jar of selenium to my project ? – Omegaspard Jun 10 '16 at 12:50
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/114359/discussion-between-remcow-and-bob-reynolds). – RemcoW Jun 10 '16 at 12:52
  • yes the node are operational – Omegaspard Jun 10 '16 at 12:53
  • @Bob use latest veraion of selenium which is `2.53.0` if it's below and also downgrade your FF version if it's latest.. – Saurabh Gaur Jun 10 '16 at 18:56
  • 2
    Possible duplicate of [Can't open browser with selenium after firefox update](http://stackoverflow.com/questions/37761668/cant-open-browser-with-selenium-after-firefox-update) – Mobrockers Jun 12 '16 at 19:30

2 Answers2

1

Apparently is a known issue for Firefox 47: https://bugzilla.mozilla.org/show_bug.cgi?id=1279127

Horatiu
  • 375
  • 3
  • 6
0

I was able to reproduce the error with Selenium-2.49.1 & FF-46.0.1.

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms.

Updating the Selenium library to 2.53.0 solved the problem

Barney
  • 1,851
  • 2
  • 19
  • 36