I am facing very weird problem, when I execute below lines of code on one M/C it returns total number of web tables present on the web page (Say 150) , but when I do same on another it returns 1.
I have checked all the QTP settings on both the machine, both are exactly same.
Set ObjPageTable = Description.Create()
ObjPageTable("html tag").Value = "Table"
Set TableObjLists = Browser("Browser").Page("Page").ChildObjects(ObjPa geTable)
NumberOfTables = TableObjLists.Count
Maybe one of these comments will help.
What happens if you change your descriptor property to something that should be equivalent, say ObjPageTable("micclass").Value = "WebTable"?
It may be some environmental factor outside QTP that causes an alteration in the page structure such that the 150 tables appear to be children of one table, instead of children of the page.
What does the table structure look like with Object Spy? Finding every table with Object Spy is partly a matter of luck, but you might hit something revealing.
How about checking your browser settings? Make sure everything is exactly the same.
As a test you could try something like this. See what it returns on both machines.
j = 0
For i = 0 to 200
If Browser("Browser").Page("Page").WebTable("index:=" &i).Exist(0) Then
j = j+1
(I'm hiring Software Development Engineers in Test in Seattle, WA)