Micro Focus QTP (UFT) Forums
Finding the correct WebTable - 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: Finding the correct WebTable (/Thread-Finding-the-correct-WebTable)



Finding the correct WebTable - mv8167 - 12-07-2011

Finding the correct WebTable:

I am stuck on how to find the currently open table in the following screen:
(see attachment)

As you open each of the Document Type links (ie CLIENT DOCUMENTS - PCG) a new set of report links open. Each Document Type could repeat names and even though the other Report Links disappear, QTP can find them.

I need to be able to find and set the table to the currently visible table.

I was using the code (table name incremented by 2)

Code:
For GrC = 1 to N

NumGr = GrC+2

If Browser("Wisdom").Page("WisdomLogin").Frame("parent").WebTable("Document Type_" & NumGr).Exist(1) Then
    Set TableObj = Browser("Wisdom").Page("WisdomLogin").Frame("parent").WebTable("Document Type_" & NumGr)
Next

But this failed to find the correct table on following iterations.

I then tried:
Code:
For GrC = 1 to N

NumGr = GrC+2
        If     Browser("Wisdom").Page("WisdomLogin").Frame("parent").WebElement("innerhtml:=" & GroupName & *, "Visible:=True").Exist(1) Then
             Set TableObj = Browser("Wisdom").Page("WisdomLogin").Frame("parent").WebElement("innerhtml:=" & GroupName, "Visible:=True")

        ElseIf     Browser("Wisdom").Page("WisdomLogin").Frame("parent").WebTable("innerhtml:= Document Type", "Visible:=True").Exist(1) Then
             Set TableObj = Browser("Wisdom").Page("WisdomLogin").Frame("parent").WebTable("innerhtml:=" & "Document Type", "Visible:=True")

        ElseIf     Browser("Wisdom").Page("WisdomLogin").Frame("parent").WebTable("innerhtml:=Document Type", "Visible:=True").Exist(1) Then
             Set TableObj = Browser("Wisdom").Page("WisdomLogin").Frame("parent").WebTable("innerhtml:=Document Type", "Visible:=True")

        ElseIf     Browser("Wisdom").Page("WisdomLogin").Frame("parent").WebTable("Document Type_" & NumGr).Exist(1) Then
             Set TableObj = Browser("Wisdom").Page("WisdomLogin").Frame("parent").WebTable("innerhtml:=Document Type", "Visible:=True") '_" & NumGr)

Next

But none of these work either.

Do you have a solution?


OSpy below
(see attachment)