2009-07-17 7 views
7

私たちはCruiseControlを使用して1時間ごとに実行するWATINテストのコレクションを用意しています。すべてのテストはローカルマシンを通過しますが、CruiseControlを使用して実行すると散発的なエラーが発生します。CruiseControlから実行したときにTimeoutExceptionでWATINテストが失敗する

CruiseControlはコマンドラインを使用して使用しています。私たちはCruiseControlサービスを使用していません。 IE8を使用しています。

各テストを実行する前に、WATINを使用してブラウザのすべてのインスタンスを閉じ、各テストが完全に分離されていることを確認します。ここで

は、例外がスローされたときに我々が見ているスタックトレースの例です:

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 

は、これを防ぐために、私たちは何がありますか?私は問題の行の前にThread.Sleep()を入れてみました。それは効果がないようです。私はかなり注意してThread.Sleep()を避けていました。そして、browser.WaitUntilContainsTextを使ってください。

私はStackOverflowとWATINのユーザーの電子メールリストを検索しました。他の人に同様の問題があったようですが、解決策は見当たりませんでした。

答えて

3

Teamcityを使用していますが、IE7でも同様の問題がありました。問題の起点がIEに開かれました。 Watinを使用して、開いているインスタンスをすべて閉じることはすでに述べています。しかし、あなたがie.ForceClose()を使用していることを確認してください。 TearDownとSetUpで

+0

良いヒントは、必ずしもそうではないようです。 – dove

0

私はWaitUntilと同じ問題がありました。しかし、それはサイトがサーバー上で信頼されていなかったためにオープンされなかったためです。タイムアウトになります。

多分あなたは同じ問題を抱えているかもしれません...