Micro Focus QTP (UFT) Forums
Links: Find, Save to Table, then Use - 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: Links: Find, Save to Table, then Use (/Thread-Links-Find-Save-to-Table-then-Use)



Links: Find, Save to Table, then Use - mv8167 - 06-02-2011

I am updating my issue...
I added anotherf scredenshot to show that the DocType changes. Somehow, I thus need to find these links, save to a table, then use the each DocType plus check each View Zip and Fax. But finding the DocType I guess the remaing links would be similar?

On the attachment, I have a web page that I need to determine all of the link names and how many of each they are, store the links in a table or buffer, then have my code go through using each link one at a time. (I need to read and use all of the Blue links on the attached page.)

IE... I need to find, save to a table, then use/select each RIG404, each View, each Zip and each Fax link one at a time. Depending on which link is used, I would run the tests for the specific link.

So...
How can I grab each link, place it in a table, then reuse each link in my script to call it? There could be 1-20… Plus rows, thus 4-80 calls.

So far I have:
Code:
Set ObjWebTable = Description.Create
ObjWebTable("class").Value = "4-column-table"
ObjWebTable("innertext").Value = ".*AllAccount No.*"

Set TableCollection = Browser(Wisdom).Page(Wisdom_Env).ChildObjects(ObjWebTable)
intTableCount = TableCollection.Count

ObjLinkRowsFound = 0

For i = 1 to intTableCountRows
For j = 0 to 4 ' (intTableCountCols)

Set ObjLink = TableCollection(i).ChildItem(i, j, "Link", 0) ' You have to check this number & change the Col number, if needed.
If ObjLink.GetROProperty("class") = "RIG404" Then
ObjLinkRowsFound = 1
Exit For
End If
Next
Next

If ObjLinkFoundRows = 1 Then
  ObjLink.Click
  Else
  'Report Something
  Messagebox = "No Reports Found"
  Exit
End If

see my attachment

thx for looking ;-)