Reputation: 53
I'm receiving the following error when executing a Selenium automated test case from Microsoft Test Manager:
Initialization method RegressionTests.Online.LoginSuccess.init threw exception. OpenQA.Selenium.WebDriverException: OpenQA.Selenium.WebDriverException: The HTTP request to the remote WebDriver server for URL http://localhost:7058/hub/session/3b544efb-cefe-4e0e-84c2-906c46bb31ea/element timed out after 60 seconds. ---> System.Net.WebException: The request was aborted: The operation has timed out..
Background:
I've created a Selenium WebDriver test in C# that executes successfully when executed on it's own in Visual Studio 2013.
Then I created a Test Case in Microsoft Test Manager and associated the Selenium test to the Test Case in Visual Studio.
As per the guide on this site, I've converted the Selenium test case to a Coded UI test case.
On my local PC I have:
When executing the test case in Microsoft Test Manager, a firefox window does open up. However nothing appears to be executed and it just times out as per the error.
Am I missing something here? I have no idea why the test times out in test manager when it works fine on it's own in Visual Studio.
Upvotes: 1
Views: 474
Reputation: 53
It appears the time out was caused by WebDriver not being able to find the site (pretty obvious really).
I was using a custom App.Config in Visual Studio to tell the test cases what site to load. The App.Config is dynamically built using SlowCheetah which transforms the App.Config according to the configuration selected in Visual Studio. This worked fine for manual builds, however for the build definitions required for Test Manager is was building the solution using the default config (which pointed to the wrong site). Hence the timeout.
What made this hard to figure out was fiddler couldn't tell me what site it was trying to load, Test Manager couldn't tell me specifically what was wrong (just a timeout).
Hope this helps someone!
Upvotes: 1