我正在尝试将一些 WatiN UI 测试应用于我的新 ASP .Net MVC 应用程序,通过 MbUnit 运行 WatiN 测试,但遇到了一些困难。
如果我按照此页面上的说明(完全正确),则加载 google 主页,插入文本,完成搜索并通过测试。(这里没问题)。
但是,当我只是更改该行的 URL 时...
var ie = new IE(new Uri("http://www.google.co.uk"));
通过 IIS(在 Win7 上)到我的 PC 上托管的网站,(例如http://localhost/myapp/
)我的应用程序的主页加载正常,但测试运行程序似乎仍在等待确认页面已加载,然后测试失败由于超时。
这是来自 IDE 内部的失败响应...
*** Failures ***
Exception
WatiN.Core.Exceptions.TimeoutException: Timeout while Internet Explorer state not complete
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.WaitWhileIEReadyStateNotComplete(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.Browser.GoTo(Uri url)
at WatiN.Core.IE.FinishInitialization(Uri uri)
at WatiN.Core.IE.CreateNewIEAndGoToUri(Uri uri, IDialogHandler logonDialogHandler, Boolean createInNewProcess)
at WatiN.Core.IE..ctor(Uri uri)
at FppRendersUI.Test.Program.DoSomething() in C:\Dev\MyCode.Test\Program.cs:line 18
其他人得到这个,还是只有我一个?