Asp.net mvc 通过MbUnit使用WatiN测试ASP.NETMVCWeb应用程序
我试图将一些WatiN UI测试应用到我的新ASP.NETMVC应用程序中,通过MbUnit运行WatiN测试,但遇到了一些困难 如果我完全按照上面的说明操作,那么谷歌主页就会加载,插入文本,搜索完成,测试通过。(这里没问题) 但是,当我简单地更改行的URL时Asp.net mvc 通过MbUnit使用WatiN测试ASP.NETMVCWeb应用程序,asp.net-mvc,unit-testing,watin,mbunit,Asp.net Mvc,Unit Testing,Watin,Mbunit,我试图将一些WatiN UI测试应用到我的新ASP.NETMVC应用程序中,通过MbUnit运行WatiN测试,但遇到了一些困难 如果我完全按照上面的说明操作,那么谷歌主页就会加载,插入文本,搜索完成,测试通过。(这里没问题) 但是,当我简单地更改行的URL时 var ie = new IE(new Uri("http://www.google.co.uk")); 通过IIS(在Win7上)访问我的电脑上托管的网站,(例如,访问http://localhost/myapp/)我的应用程序的主页
var ie = new IE(new Uri("http://www.google.co.uk"));
通过IIS(在Win7上)访问我的电脑上托管的网站,(例如,访问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
其他人都明白了,还是只有我一个人?在locahost上测试一个网站应该没有明显的区别 两个可能的原因:
如果这些都没有帮助的话,WatiN也有一些“NoWait”变体,比如点击。您还可以通过注册WaitForComplete处理程序来覆盖等待页面完成对WatiN的意义。在locahost上测试网站应该没有显著差异 两个可能的原因:
如果这些都没有帮助的话,WatiN也有一些“NoWait”变体,比如点击。您还可以通过注册WaitForComplete处理程序来覆盖等待页面完成对WatiN的意义。当我有一个未加载的资源引用时,我就遇到了这种情况
- 是否有对不存在的JS、CSS或图像文件的引用
- 如果使用查看HTTP流量,您是否看到任何连接超时
- 是否有对不存在的JS、CSS或图像文件的引用
- 如果使用查看HTTP流量,您是否看到任何连接超时