I've been trying to figure out how to get QTP to recognize a record (in this case the name of a training class) in a list and its associated action icons (Edit, Delete, etc.) and I think I'm close, but I could use some help on getting to the next step.
I used ObjectSpy to find out the innerHTML properties of both the record and the table cell containing the action icons have the name of the training class embedded in them. GREAT! So, knowing this...how can I program a command that which locates the name of the class and activates one of its associated icons?
Here's what I've found and noted so far:
'*** innerHTML for the Class Name ***
'Aerial Lift Operator Qualification
I'm on QTP 9.5 (though a request has been put in with my employer to update to v11).
Jonty, I assume you are meaning as displayed in Object Spy? I'm attaching a screenshot of both the Class Name Text and the Delete icon. I think I see where you're going with this as the WebTable property has the name of the class contained within it. So if I use as that property the name of the class, I can locate both the line with the class and its associated Delete icon, correct?
Now to figure out how to get QTP to know "Find this object based on this name" and activate it. Wow, that moved me well ahead, thank you. Any other suggestions are more than welcome!
A table contains a few columns
Column1: training class name
Column2: Detelte image
Column3: Edit image
If the above is correct, do the following (pseudocode)
Set table = Browser.Page.webtable
For i to table.GetRowCount
If Table.GetCellData(i, 1) = strClassName Then
Set imgDelete = table.ChildItem (i, 2, "Image", 0)
Set imgEdit = table.ChildItem (i, 3, "Image", 0)
then you do whatever you want with imgDelete and imgEdit