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.Firefox.FirefoxDriver..ctor(FirefoxBinary binary, FirefoxProfile profile, TimeSpan commandTimeout)
at FluentAutomation.SeleniumWebDriver.AutomationProvider.Navigate(Uri pageUri)
at FluentAutomationDemo.Integration.TestClass1.Test() in Class1.cs: line 19
Figure 1: Selenium test failure in Visual Studio |
The latest version of the FluentAutomation uses the Selenium.WebDriver v2.8. This FluentAutomation can be installed via NuGet using the Package Manager Console:
PM> Install-Package FluentAutomation.SeleniumWebDriver
Alternatively, you can get the code on GitHub here: https://github.com/stirno/FluentAutomation The C# code I used to generate this error looks like the following:
using FluentAutomation.API.Enumerations;
using NUnit.Framework;
namespace FluentAutomationDemo.Integration
{
public class TestClass1 : FluentAutomation.SeleniumWebDriver.FluentTest
{
[Test]
public void Test()
{
I.Use(BrowserType.Firefox);
I.Open("http://www.google.com");
I.Enter("Fluent Automation API").In("#lst-ib");
}
}
}
So as you can see, it is simply trying to insert Fluent Automation API in the search box of a Google page using FireFox. It seems the Selenium WebDriver does not support the latest version of Firefox which is at the time of writing: 8.0.1. A workaround is to downgrade to Firefox v7.0.1.
To do this you then need to uninstall Firefox and download an old version from here (you can't get the old versions from the Firefox site): http://www.oldapps.com/firefox.php
Figure 2: Removing Firefox 8.0.1 |
To turn off the auto-update feature, simply un-tick the Firefox check box as in Figure 3 below, then click OK.
Figure 3: Firefox advanced options |