Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium WebDriver - FirefoxDriver error: Failed to start up socket within 45000

I'm getting this error:

tests.IntegrationTests.Selenium.RegisterAndLogin (TestFixtureSetUp):
SetUp : OpenQA.Selenium.WebDriverException : Failed to start up socket within 45000

when I carry out the following in my code:

using System;
using System.Text;
using NUnit.Framework;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium;

namespace ekmProspector.tests.IntegrationTests.Selenium
{
    [TestFixture]
    public class RegisterAndLogin
    {
        private IWebDriver driver;   

        [TestFixtureSetUp]
        public void Init()
        {            

            driver = new FirefoxDriver();
        }
}

Can't get much simpler really, but the error is fatal. Any ideas?

like image 856
jaffa Avatar asked Oct 05 '11 13:10

jaffa


1 Answers

None of the previous answers clearly state that specific versions of Selenium WebDriver work with specific versions of Firefox. This SO question tells us that the Webdriver/Firefox compatibility matrix is here.

The other thing worth stating is that Firefox tends to update itself more-or-less automatically when new versions become available, depending on settings. Since Webdriver does not update itself automatically, this opens up the possibility that the Webdriver/Firefox compatibility will unexpectedly break and your test scripts will stop running when Firefox updates itself to a version that is not supported by your Webdriver version. I suspect that the answers above that instruct users to re-install Webdriver using Nuget simply pick up the newest Webdriver which works with the newest Firefox that just installed itself on your machine.

To prevent Firefox from upgrading itself, click on the menu button in Firefox (three horizontal bars, upper-right corner), choose "Options", choose "Advanced" on the left menu, choose the "Update" tab at the top and you'll see a set of radio buttons under "Firefox updates". Choose a setting other that "Automatically install updates".

like image 71
sevzas Avatar answered Oct 10 '22 20:10

sevzas