Having problems running WatiN on Windows 7 with IE 8

那年仲夏 提交于 2019-12-12 20:08:13

问题


When I run any WatiN test on Windows 7 with IE8(note that all tests pass on Vista with IE8), the browser displays the first page but does not go any further. The following exception is displayed after a few seconds:

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(DoFunc1 func) at WatiN.Core.WaitForCompleteBase.WaitUntil(DoFunc1 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(String url) at CCS.iPS.ST.Tests.UIWithDBVerification.Tests.DCC_Offered_Completed_ThreeDS_And_Authorisation_Completed() in Tests.cs: line 18


回答1:


Make sure you are running as an Administrator. Seems to be an issue where Watin can't access the DOM in IE unless the application is running with System Administrator privileges.




回答2:


I know this is an ancient thread, but I've found found a workaround for WatiN under Windows 7 that doesn't require you to run as an administrator (which isn't allowed in my company :S) If you disable protected mode in Internet Explorer it should run fine: -

1 - Open internet explorer.
2 - Click on Tools menu and select Internet Options.
3 - Select Security Tab in the Internet options windows.
4 - Select Internet from the zone settings.
5 - Uncheck Enable Protected Mode option to disable the protection from Security for this zone.
6 - Hit Apply and Ok


来源:https://stackoverflow.com/questions/1999109/having-problems-running-watin-on-windows-7-with-ie-8

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