eval javascript 代码时出现 WatiN 权限问题
我的环境是: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)
我知道是关于权限问题,但我不知道如何解决它。 关于这个问题的任何想法。
My environment is: WindowXP, IE8, VS2008, WatiN-2.0.20
When i try to execute the follow code:
IE _browser = new IE();
_browser.GoTo(_url);
_browser.Eval("alert('hello!');");
I get the following error:
Message:
"Access denied. (Exception of HRESULT: 0x80070005 (E_ACCESSDENIED))"
Source:
"Microsoft.mshtml"
Partial 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)
I know is about a premissions problem but i don't know how solve it.
Any ideas about this issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试关闭 IE 的保护模式或将您的网站添加到受信任区域。
Try turning off IE's protected mode or add your site to trusted zone.