kaptux
kaptux

Reputation: 453

WatiN permissions problem when eval javascript code

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.

Upvotes: 5

Views: 4133

Answers (1)

prostynick
prostynick

Reputation: 6219

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

Upvotes: 10

Related Questions