set pageURL failed for IE

Bug reports.
hobli
Posts: 57
Joined: Thu Jul 30, 2009 1:15 am

set pageURL failed for IE

Post by hobli » Fri Jun 25, 2010 4:49 am

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: set pageURL failed for IE

Post by Support Team » Fri Jun 25, 2010 9:38 am

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
.
Image