I have been using Selenium for several months, which we use to automate some of our internal testing processes. The scripts went fine. I recently upgraded to C # 2.40.0 webdriver using FF 27.01, and our scripts now fail in random places with the following error.
[Portal.SmokeTest.SmokeRunTest.Booking] TearDown method failed. OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL htt(p)://localhost:7055/hub/session/56e99e88-ba17-4d12-bef1-c6a6367ccc2f/element timed out after 60 seconds. ----> System.Net.WebException : The operation has timed out TearDown : OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL htt(p)://localhost:7055/hub/session/56e99e88-ba17-4d12-bef1-c6a6367ccc2f/window timed out after 60 seconds. ----> System.Net.WebException : The operation has timed out [09:01:20] [Portal.SmokeTest.SmokeRunTest.Booking] TearDown method failed. OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL htt(p)://localhost:7055/hub/session/56e99e88-ba17-4d12-bef1-c6a6367ccc2f/element timed out after 60 seconds. ----> System.Net.WebException : The operation has timed out TearDown : OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL htt(p)://localhost:7055/hub/session/56e99e88-ba17-4d12-bef1-c6a6367ccc2f/window timed out after 60 seconds. ----> System.Net.WebException : The operation has timed out at OpenQA.Selenium.Support.UI.DefaultWait`1.PropagateExceptionIfNotIgnored(Exception e) at OpenQA.Selenium.Support.UI.DefaultWait`1.Until[TResult](Func`2 condition) at Portal.Test.Helpers.Process_Bookings.OpenBookings.SelectBooking(String bookingnumber) at Portal.SmokeTest.SmokeRunTest.Booking() in d:\TeamCityAgent\work\dac1dcea7f2e80df\SmokeTests\SmokeRunTest.cs:line 68 --WebException at System.Net.HttpWebRequest.GetResponse() at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request) --TearDown at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request) at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute) at OpenQA.Selenium.Firefox.Internal.ExtensionConnection.Execute(Command commandToExecute) at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) at OpenQA.Selenium.Remote.RemoteWebDriver.Close() at Portal.Test.Helpers.Setup.CloseWebdriver() at Portal.SmokeTest.SmokeRunTest.TearDown() in d:\TeamCityAgent\work\dac1dcea7f2e80df\SmokeTests\SmokeRunTest.cs:line 162 --WebException at System.Net.HttpWebRequest.GetResponse() at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request)
The last error that I was able to search for a single line of code:
_setup.driver.FindElement(By.XPath("//button[@class='buttonSmall lockBookingButton']")).Click();
Itβs annoying that trying to fix the problem is difficult, as if I ran the test on my local machine, it goes through in debugging. Also, if I run it through the NUNIT runner on the build machine, I run the test, it also passes. This does not seem to be the case as part of our automatic build process when using Teamcity. As I said, that was nice for a few months ago, and the only thing that has changed is the selenium web selenium kit.
I ran into this problem earlier, while in debugging, and when the Click() line of code was called, Firefox seemed to block, and only stopping the test would allow Firefox to continue. Are there several suggestions here, including changing the webdriver source? I would not want to go down this route, if possible, if anyone else can offer any suggestions.
c # selenium nunit selenium-webdriver teamcity
Nathan Mar 11 '14 at 10:13 2014-03-11 10:13
source share