1

My selenium test in C# works fine locally, but fails when it is run by the automated build. This is the error:

2017-09-13T00:33:05.1795606Z

[error]OpenQA.Selenium.WebDriverException: The HTTP request to the remote WebDriver server for URL

http://localhost:26888/session/c538ded8-515b-4a93-8862-4756db443110/element/877e16fe-bc77-4125-9b0f-79edc66547c0/click timed out after 60 seconds. ---> System.Net.WebException: The operation has timed out 2017-09-13T00:33:05.1795606Z ##[error]Stack Trace: 2017-09-13T00:33:05.1795606Z ##[error] at System.Net.HttpWebRequest.GetResponse() 2017-09-13T00:33:05.1795606Z

[error] at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest

request) 2017-09-13T00:33:05.1795606Z ##[error] --- End of inner exception stack trace --- 2017-09-13T00:33:05.1951843Z ##[error] at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request) 2017-09-13T00:33:05.1951843Z ##[error] at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute) 2017-09-13T00:33:05.1951843Z ##[error] at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute) 2017-09-13T00:33:05.1951843Z ##[error] at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) 2017-09-13T00:33:05.1951843Z ##[error] at OpenQA.Selenium.Remote.RemoteWebElement.Click()

OS: Windows Server 2012 R2 Standard BROWSER: IE 11 Selenium.WebDriver.IEDriver: version="3.5.1"

I tried adding implicit wait and also thread.sleep before the click, but they did not help. I increased the timeout seconds to 180 by using

driver = new InternetExplorerDriver(ieDriverService, options, TimeSpan.FromSeconds(180));

instead of

driver = new InternetExplorerDriver();

But that did not help either. The operation still times out. Does anyone know why this is happening and how I can resolve it?

Update 1: The same test passed successfully by automated build when I used PhantomJS instead of IE.

Update 2: The remote machine is allowing user interaction. I have some other clicks in my code that work fine during the automated build. It is just this one link that opens a page that includes a script editor (in silverlight) that times out.

Update 3: It is AFTER the Click that the page hangs.

Update 4: This problem is resolved by moving to a new build server.

  • Does the remote system have GUI? IE does not have a headless mode, if I recall correctly, so you would need to have an open, interactive desktop environment – Kate Paulk Sep 14 '17 at 19:31
  • The remote machine (build machine) has IE 11. – Golnaz.r Sep 14 '17 at 21:22
  • 1
    Selenium simulates user interaction with the browser. If the remote machine isn't allowing user interaction - because it's locked or for some other reason - your test will fail. The fact that the test passed with PhantomJS suggests this is the problem. – Kate Paulk Sep 15 '17 at 11:27
  • But the remote machine is allowing user interaction. I have some other clicks in my code that work fine during the automated build. It is just this one link that opens a page that includes a script editor (in silverlight) that times out. – Golnaz.r Sep 19 '17 at 23:20
  • Please update your question with that information. – Kate Paulk Sep 20 '17 at 11:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.