Micro Focus QTP (UFT) Forums
GetROProerty not working in subsequent iterations - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: GetROProerty not working in subsequent iterations (/Thread-GetROProerty-not-working-in-subsequent-iterations)



GetROProerty not working in subsequent iterations - MichaelS - 03-17-2011

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")".



RE: GetROProerty not working in subsequent iterations - basanth27 - 03-17-2011

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.


RE: GetROProerty not working in subsequent iterations - MichaelS - 03-17-2011

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.


RE: GetROProerty not working in subsequent iterations - basanth27 - 03-17-2011

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.