12-07-2011, 02:38 AM
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)
But this failed to find the correct table on following iterations.
I then tried:
But none of these work either.
Do you have a solution?
OSpy below
(see attachment)
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)