Page 1 of 1

set pageURL failed for IE

Posted: Fri Jun 25, 2010 4:49 am
by hobli
Hi,

I have the following code:

Code: Select all

m myDoc As WebDocument
myDoc = "<webdocument rxpath>"
myDoc.EnsureVisible()
myDoc.Navigate("file://path to my local html file")
When I run the code with IE7.0, it throws following exception:

Code: Select all

Ranorex.SetAttributeFailedException: Setting attribute 'pageurl' failed on element '{WebDocument:blank}'.  System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
   at mshtml.IHTMLDocument2.set_url(String p)
   at Ranorex.Plugin.WebDocumentFlavorElement.SetAttributeValue(Element element, String name, Object value)
   at Ranorex.Core.Element.SetAttributeValue(String name, Object value)
   --- End of inner exception stack trace ---
   at Ranorex.Core.Element.SetAttributeValue(String name, Object value)
   at Ranorex.WebDocument.set_PageUrl(String value)
   at Ranorex.WebDocument.Navigate(String url, Boolean waitForLoaded, Duration timeout)
   at Ranorex.WebDocument.Navigate(String url, Boolean waitForLoaded)
   at Ranorex.WebDocument.Navigate(String url)
When I change the url string to normal http://xxx, it works. I tried the same code with FireFox3.6.3, it works with page url: file:///<path to my local file>

if this is a bug for Ranorex?

thanks

Re: set pageURL failed for IE

Posted: Fri Jun 25, 2010 9:38 am
by Support Team
Hi,
hobli wrote:if this is a bug for Ranorex?
It's not a bug in Ranorex, it depends on the URL Security Zones of Internet Explorer. You are not allowed to switch between URL Security Zones. Please read following link
http://msdn.microsoft.com/de-de/library/ms537183.aspx

As workaround you can initialize your IE with an URL which is in the expected Security Zone. Then you should be able to navigate with Ranorex inside this Security Zone.

But we are looking for a possible solution to fix this problem.

Regards,
Peter
Ranorex Support Team