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 |
4 comments:
Thanks for the steps Simon! This was about to drive me crazy. On a related note, I've found that going to About->Help in Firefox will automagically download and install the latest version. So make sure to turn the update settings off first thing.
It's annoying that Firefox defaults to upgrading the application without the users say so. I'd expect it to at least at the user what they would like to do when they install the browser.
I think if you installed the Selenium Firefox plugin, you do get notified that upgrading will break Selenium.
I can only guess (without running something like TcpView) that the port Firefox listens on for Webdriver interaction has now changed to something that Selenium doesn't expect.
Simon
Simon, thanks for posting the steps to fix this. Wish I'd of seen it earlier.
The latest in source builds against a newer version of Selenium and is tested to work up to Firefox 10 now.
- stirno, FluentAutomation
Thanks stirno, I'll be sure to update this blog post and check it out.
--
Simon
Post a Comment