从CruiseControl运行时WATIN测试失败,出现TimeoutException [英] WATIN tests failing with TimeoutException when run from CruiseControl

查看:119
本文介绍了从CruiseControl运行时WATIN测试失败,出现TimeoutException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一些WATIN测试,我们使用CruiseControl每小时运行一次。所有测试都在我们的本地计算机上通过-但是当使用CruiseControl运行它们时,我们会偶尔遇到故障。

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.

我们正在通过命令行使用CruiseControl。我们没有使用CruiseControl服务。我们正在使用IE8。

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

在运行每个测试之前-我们使用WATIN关闭浏览器的所有实例,以确保每个测试都是完全隔离的。

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

有没有东西g我们这样做是为了防止吗?我尝试将Thread.Sleep()放在令人讨厌的行的前面。这似乎没有效果。我一直非常小心,避免使用Thread.Sleep()-并使用browser.WaitUntilContainsText。

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.

我已经搜索了StackOverflow和WATIN用户的电子邮件列表-似乎其他人们曾经遇到过类似的问题,但是我没有看到任何解决方案。

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.

推荐答案

我们正在使用Teamcity,但是IE7却存在类似的问题。问题的根源是打开的IE。您已经提到使用Watin关闭所有打开的实例。但是请确保使用ie.ForceClose();。在TearDown和SetUp中。

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.

这篇关于从CruiseControl运行时WATIN测试失败,出现TimeoutException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆