Micro Focus QTP (UFT) Forums

Full Version: GetROProerty not working in subsequent iterations
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I am new to QTP and having an issue with GetROProperty. Is this what I should use in this situation or is there someting better than GetROProperty. I am using QTP11 with IE7.

The following code works fine as as long as the list box does not change.

Code:
Browser("Certificate Error: Navigation_2").Page("Page_9").Link("Profile Classes").Click
Browser("Certificate Error: Navigation_2").Page("Page_3").WebList("classes").Select "User"
Browser("Certificate Error: Navigation_2").Page("Page_3").Image("P_01-over").FireEvent "onmouseover"
Browser("Certificate Error: Navigation_2").Page("Page_3").Image("P_01-over").Click
sItemsInUserList=Browser("Browser").Page("Page").WebList("prfid").getroproperty("all items")
If instr(1,sItemsInUserList,sUser) > 0 Then
    bQTPUserExists=True
Else
    bQTPUserExists=False
End If

When the list box has change since the last iteration, the following error is dispayed. I am attempting to check the existence of a user, prior to adding a new one.

Cannot identify the object "prfid" (of class WebList). Verify that this object's properties match an object currently displayed in your application.

Line (94):
Code:
"sItemsInUserList=Browser("Browser").Page("Page").WebList("prfid").getroproperty("all items")".
When the error occurs open the repository and higlight the object in the app. Does it throw the same error when you use that option? If yes, spy and find out what property is changing?
Let me know if you need more info.
The Object Repository give me the same error.

It shows under test objects
Browser
page
prfid


The Object SPy shows:

Browser
page
WebTable: Number of Profiles: 12822
Weblist: prfid

I think the only difference is the prior version would have had 12821 profiles.
After you get tge error, add that weblist into the repository and see which property has changed from the first one. There definitely is a change either in the name property.
We may have to regular expression the property change. Please update the outcome.