开发者

WatiN permissions problem when eval javascript code

开发者 https://www.devze.com 2023-01-20 23:10 出处:网络
My environment is: WindowXP, IE8, VS2008, WatiN-2.0.20 When i try to execute the follow code: IE _browser = new IE();

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)
 开发者_StackOverflow  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.


Try turning off IE's protected mode or add your site to trusted zone.

0

精彩评论

暂无评论...
验证码 换一张
取 消