WATIN tests failing with TimeoutException when run from CruiseControl

有些话、适合烂在心里 提交于 2019-12-22 04:57:23

问题


We have a collection of WATIN tests we are using CruiseControl to run every hour. All the tests pass on our local machine - but when they are run using CruiseControl we get sporadic failures.

We are using CruiseControl using the command line. We are not using the CruiseControl service. We are using IE8.

Before each test is run - we use WATIN to close all instances of the browser to make sure each test is completely isolated.

Here is an example of the stack trace we are seeing when the exception is thrown:

Message: WatiN.Core.Exceptions.TimeoutException : Timeout while Internet Explorer busy 
at WatiN.Core.UtilityClasses.TryFuncUntilTimeOut.ThrowTimeOutException(Exception lastException, String message)
at WatiN.Core.UtilityClasses.TryFuncUntilTimeOut.HandleTimeOut()
at WatiN.Core.UtilityClasses.TryFuncUntilTimeOut.Try[T](DoFunc`1 func)
at WatiN.Core.WaitForCompleteBase.WaitUntil(DoFunc`1 waitWhile, BuildTimeOutExceptionMessage exceptionMessage)
at WatiN.Core.Native.InternetExplorer.WaitForComplete.WaitWhileIEBusy(IWebBrowser2 ie)
at WatiN.Core.Native.InternetExplorer.IEWaitForComplete.DoWait()
at WatiN.Core.DomContainer.WaitForComplete(IWait waitForComplete)
at WatiN.Core.IE.WaitForComplete(Int32 waitForCompleteTimeOut)
at WatiN.Core.DomContainer.WaitForComplete()
at WatiN.Core.Element.WaitForComplete()
at WatiN.Core.Element.Click()
at Symetra.Web.Core.AutomatedTesting.WatiNTests.CommonTests.LinkTest(Browser browser, String linkText, String message) in d:\Source\BuildArea\OSS\Symetra.Web.Core.AutomatedTesting\Symetra.Web.Core.AutomatedTesting.WatiNTests\Common\CommonTests.cs:line 63
at Symetra.Web.Core.AutomatedTesting.WatiNTests.CommonTests.LinkTest(Browser browser, String linkText) in d:\Source\BuildArea\OSS\Symetra.Web.Core.AutomatedTesting\Symetra.Web.Core.AutomatedTesting.WatiNTests\Common\CommonTests.cs:line 57
at Symetra.Web.Core.AutomatedTesting.WatiNTests.GlowTests.BreadCrumbFixture.testid1Test() in d:\Source\BuildArea\OSS\Symetra.Web.Core.AutomatedTesting\Symetra.Web.Core.AutomatedTesting.WatiNTests\GlowTests\BreadCrumbFixture.cs:line 72

Is there anything we do to prevent this? I’ve tried putting Thread.Sleep() in front of the offending lines. That does not seem to have an effect. I’ve been pretty careful to avoid Thread.Sleep()- and use browser.WaitUntilContainsText.

I’ve searched StackOverflow and the WATIN users email lists - it seems other people have had similar problems but I did not see any solutions.


回答1:


We are using Teamcity, but we had similar problem with IE7. The origin of problem was opened IE. You already mention that you use Watin to close all open instances. But make sure that you use ie.ForceClose(); in TearDown and SetUp.




回答2:


I had the same problem with WaitUntil. But it was only because the site was not trusted on the server and so didn't open so i get a time out.

Maybe you get the same problem...



来源:https://stackoverflow.com/questions/1145619/watin-tests-failing-with-timeoutexception-when-run-from-cruisecontrol

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!