我的环境是: WindowXP,IE8,VS2008,WatiN-2.0.20
当我尝试执行以下代码时:
IE _browser = new IE();
_browser.GoTo(_url);
_browser.Eval("alert('hello!');");我得到以下错误:
消息:
"Access denied. (Exception of HRESULT: 0x80070005 (E_ACCESSDENIED))"来源:
"Microsoft.mshtml"部分StackTrace
in WatiN.Core.Native.InternetExplorer.IEUtils.RunScript(String scriptCode, String language, IHTMLWindow2 window)
in WatiN.Core.Native.InternetExplorer.IEDocument.RunScript(String scriptCode, String language)
in WatiN.Core.Document.RunScript(String scriptCode, String language)
in WatiN.Core.Document.RunScript(String javaScriptCode)
in WatiN.Core.Document.Eval(String javaScriptCode)我知道是关于预科的问题,但我不知道如何解决它。关于这个问题的任何想法。
发布于 2010-10-21 19:29:21
请尝试关闭IE的保护模式或将您的站点添加到受信任区域。
https://stackoverflow.com/questions/3986477
复制相似问题