MNiebylski
MNiebylski

Reputation: 41

OpenQA.Selenium.WebDriverException: The HTTP request to the remote WebDriver server for URL timed out

I'm using TeamCity (v8.0.5) to run tests that use Selenium WebDriver (v 2.47). To this time everything worked perfectly on ChromeDriver (v 2.16), but serveral days ago it simply stopped working, the error is as follows:

[19:34:04][chrome] Starting ChromeDriver 2.16.333243 (0bfa1d3575fc1044244f21ddb82bf870944ef961) on port 49354
[19:34:04][chrome] Only local connections are allowed.
[19:35:07][chrome] 
[19:35:07][chrome] Unhandled Exception: OpenQA.Selenium.WebDriverException: The HTTP request to the remote WebDriver server for URL http://localhost:49354/session timed out after 60 seconds. ---> System.Net.WebException: The operation has timed out
[19:35:07][chrome]    at System.Net.HttpWebRequest.GetResponse()
[19:35:07][chrome]    at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\HttpCommandExecutor.cs:line 141
[19:35:07][chrome]    --- End of inner exception stack trace ---
[19:35:07][chrome]    at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\HttpCommandExecutor.cs:line 151
[19:35:07][chrome]    at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\DriverServiceCommandExecutor.cs:line 78
[19:35:07][chrome]    at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\RemoteWebDriver.cs:line 910
[19:35:07][chrome]    at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\RemoteWebDriver.cs:line 88
[19:35:07][chrome]    at MWLIS.WebUI.UITests.MwlisChromeDriverWrapper.Initialize() in c:\TeamCity\buildAgent\work\5274d544715210e7\src\MWLIS.WebUI.UITests\Program.cs:line 170
[19:35:07][chrome]    at OpenWaves.UITesting.Runner.ScenarioRunner.RunScenariosWithDriver(IEnumerable`1 scenarios, WebDriverWrapperBase driver) in c:\SVN\OpenWaves.UITesting\OpenWaves.UITesting\Runner\ScenarioRunner.cs:line 33
[19:35:07][chrome]    at OpenWaves.UITesting.Runner.TeamCityScenarioRunner.RunScenariosWithDriver(IEnumerable`1 scenarios, WebDriverWrapperBase driver) in c:\SVN\OpenWaves.UITesting\OpenWaves.UITesting\Runner\TeamCityScenarioRunner.cs:line 41
[19:35:07][chrome]    at OpenWaves.UITesting.Runner.ScenarioRunner.Run(Func`2 getTestsFunc) in c:\SVN\OpenWaves.UITesting\OpenWaves.UITesting\Runner\ScenarioRunner.cs:line 26
[19:35:07][chrome]    at MWLIS.WebUI.UITests.Program.Main(String[] args) in c:\TeamCity\buildAgent\work\5274d544715210e7\src\MWLIS.WebUI.UITests\Program.cs:line 69

I was suspecting that maybe Chrome update caused this problem, but it gives me the same result for FirefoxDriver and InternetExplorerDriver. I was also suspecting some problem with "silent" Windows Authentication that I perform in tests (passing username and password as a part of url), but I managed to run tests locally on the same server that TeamCity is hosted, so I'm not sure what is root cause of the problem.

I saw a lot of similar questions about Selenium timeouts on this forum, like this OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server timeout or this Selenium tests, Continuous Integration. The HTTP request to the remote WebDriver server for URL http://localhost, but none answer helps in my case.

Any ideas? Please help.

Upvotes: 2

Views: 3579

Answers (1)

MNiebylski
MNiebylski

Reputation: 41

Ok, I found a workaround of this problem. I switched from "real" browsers to PhantomJS via PhatnomJSDriver, and now I don't observer these timeouts anymore.

The other approach, that worked for me is a BrowserStack cloud platform (https://www.browserstack.com), which allows to test on any browser, any OS using RemoteWebDriver and browser capabilities.

I hope someone find this useful.

Upvotes: 2

Related Questions