Micro Focus QTP (UFT) Forums

Full Version: GetROProperty error when used in a for loop
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I have the below code. It works until I get to the first if statement and leave the page and then return back. Then it breaks with a General Run error. Any ideas?

Code:
Set links = Description.Create
links("micclass").value = "Link"

set allLinks = Browser("BROWSER").Page("PAGE").ChildObjects(links)
link_count = allLinks.count

For i=0 to link_count -1    
    [u][b]url_temp = allLinks(i).GetROProperty("href")    [/b][/u]    
              If inStr(url_temp, "javascript:gotoLINK") then
        url_temp = Replace(url_temp,"javascript:","")
        url_temp = Replace(url_temp,";","")
        Browser("BROWSER").Page("PAGE").RunScript(url_temp)
        Browser("BROWSER").Sync
                           Browser("BROWSER").Page("PAGE").Link("RETURN_TO_HOME").Click
    end if
Next
What version of IE are you using??

Are you getting the proper count for child objects? Do check.

Regards,
Ankesh
Using IE 8 and the child count is correct.