Failed to start up socket within 45000

17,688

Solution 1

Firefox 19 'support' was added in Selenium's latest versions. So since you are using .NET, the direct download for the latest at the time of this post is version 2.31.2:

selenium-release.storage.googleapis.com/index.html

Solution 2

I have this issue with Firefox 43 and Selenium 2.48. It happens when your Selenium driver server is running in a 32 bit process and you start the 64 bit version of Firefox.

The cause is that the webdriver server tries to connect to port 7055 which should be opened by the webdriver that runs in the Firefox executable. But you can see in TcpView from www.sysinternals.com that Firefox does not open this port. So the driver waits until his timeout (45 seconds) elapses.

This happens even after turning off the Windows Firewall completely.

All posts that I found in internet do NOT help: Upgrade Selenium, downgrade Firefox, etc..

But after installing the 32 bit version of the same Firefox 43 it works. I see in TcpView how Firefox 32 bit opens the port correctly:

Firefox Selenium webdriver Port 7055

In my code I use

FirefoxProfile Prof = new FirefoxProfile();
FirefoxBinary  Bin  = new FirefoxBinary(sBrowserExe);
mDriver = new FirefoxDriver(Bin, Prof);

With sBrowserExe = "C:\Program Files\Mozilla Firefox 43\firefox.exe" the 64 bit version of Firefox 43 is started and I get the timeout exception.

With sBrowserExe = "C:\Program Files (x86)\Mozilla Firefox 43\firefox.exe" the 32 bit version of Firefox 43 is started and it works!


UPDATE: The developers from Firefox now broke Selenium support COMPLETELY. New Firefox versions from 48 upwards need a digital signature for all extensions to be installed.

https://wiki.mozilla.org/Addons/Extension_Signing

What I don't understand is why Selenium people cannot get a signature for the current Selenium driver??

Firefox version 47.0 has a bug that does not allow to use it with Selenium. This bug has been fixed in version 47.0.1.

Firefox versions from 48.0 and above do not install the old Selenium driver anymore. They must be automated with Marionette (= Gecko) driver.

The problem is that Marionette is still beta and has a lot of missing features so there is currently no solution to automate the new Firefox versions.

As you see here the new driver is full of bugs: https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver/status

Solution 3

If Upgrading Webdriver doesn't help you can downgrade FireFox that will solve issue.

Solution 4

Which version of Selenium IDE you are using? Try downgrading the Firefox version. The release notes of selenium IDE is mentioned in below link.

https://code.google.com/p/selenium/wiki/SeIDEReleaseNotes

Hope this helps.

Share:
17,688

Related videos on Youtube

Nick Kahn
Author by

Nick Kahn

Updated on June 07, 2022

Comments

  • Nick Kahn
    Nick Kahn almost 2 years

    I'm using FF version 19

    it was all working fine till yesterday and suddenly today morning i start getting this error and i have the same exact code that was running before, no change nothing

    error message:

    Test 'M:.TestCases.12' failed: Failed to start up socket within 45000
        OpenQA.Selenium.WebDriverException: Failed to start up socket within 45000
        at OpenQA.Selenium.Firefox.Internal.ExtensionConnection.ConnectToBrowser(Int64 timeToWaitInMilliSeconds)
        at OpenQA.Selenium.Firefox.Internal.ExtensionConnection.Start()
        at OpenQA.Selenium.Firefox.FirefoxDriver.StartClient()
        at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
        at OpenQA.Selenium.Firefox.FirefoxDriver..ctor(FirefoxBinary binary, FirefoxProfile profile, TimeSpan commandTimeout)
        at OpenQA.Selenium.Firefox.FirefoxDriver..ctor(FirefoxBinary binary, FirefoxProfile profile)
        at OpenQA.Selenium.Firefox.FirefoxDriver..ctor(FirefoxProfile profile)
    
    0 passed, 1 failed, 0 skipped, took 145.80 seconds (Ad hoc).
    

    here is my source code:

    public static IWebDriver GetDriver()
            {
                switch (Common.BrowserSelected)
                {
                    case "ff":
                        FirefoxProfile profile = new FirefoxProfile();
                        profile.SetPreference("network.http.phishy-userpass-length", 255);
                        profile.SetPreference("network.automatic-ntlm-auth.trusted-uris", url);
                        drv = new FirefoxDriver(profile);
                        break;
                    case "ie":
                        var options = new InternetExplorerOptions();
                        options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
                        DesiredCapabilities capabilities = new DesiredCapabilities();
                        capabilities.SetCapability(CapabilityType.AcceptSslCertificates, true);
                        drv = new InternetExplorerDriver(options);
                        break;
                    case "chrome":
                        //_driver = new ChromeDriver();
                        break;
                }
                return drv;
            }
    
    • HemChe
      HemChe about 11 years
      may be Firefox browser got updated?
    • Nick Kahn
      Nick Kahn about 11 years
      ff 19 is the latest so i am not sure
    • Arran
      Arran about 11 years
      What Selenium version are you using? I know until it's latest version, it had issues with Firefox.
    • Nick Kahn
      Nick Kahn about 11 years
      i'm using 2.25.1.0 selenium webdriver version.
    • Arran
      Arran about 11 years
      @AbuHamzah, in which case definitely update. I believe Firefox 19 "support" wasn't added until very recently (v2.31 I think?). So update and come back if it still doesn't work.
    • Nick Kahn
      Nick Kahn about 11 years
      you mean update the selenium webdriver? and to what version?
    • Arran
      Arran about 11 years
      Yeah, update Selenium WebDriver to v2.31.2, direct link is here: code.google.com/p/selenium/downloads/…
    • HemChe
      HemChe about 11 years
      @AbuHamzah Download the latest Java-Selenium binding present at selenium.googlecode.com/files/selenium-java-2.31.0.zip which got released recently on Feb 27th 2013. Hopefully it should serve your purpose.
    • Nick Kahn
      Nick Kahn about 11 years
      thank you Arran and HemChe after i update to v2.31.2 it works :), please reply as an answer and i will accept that.
  • phabtar
    phabtar about 10 years
    Now get the latest versions from here : selenium-release.storage.googleapis.com/index.html
  • Elmue
    Elmue about 8 years
    The idea is to test on the latest Firefox version. Downgrading Firefox is NOT a solution!
  • Elmue
    Elmue about 8 years
    The idea is to test on the latest Firefox version. Downgrading Firefox is NOT a solution!
  • Elmue
    Elmue about 8 years
    This does not solve the problem. I have the same timeout exception even with Selenium 2.48.
  • Elmue
    Elmue about 8 years
    Not a good idea: This is the third result in Google searching for the abover error message. Many people will come here and read this.
  • MasterJoe
    MasterJoe over 7 years
    I use firefox 48, 32 bit on a windows 7, 64 bit machine. I still get the error you mentioned. However, in TCPView, firefox does not open port 7055. Please suggest how I can fix this.