Reputation: 163
I am trying to fetch the count of tables present on a website. I am executing this code through QTP, but I get the count zero.
Set my_page=Browser("title:=.*").Page("title:=.*")
Set table_desc= description.Create
table_desc("html_tag").value="TABLE"
Set all_tables=my_page.ChildObjects(table_desc)
total_no_tables=all_tables.count
msgbox total_no_tables
What should I need to add in order to get the table count?
Upvotes: 1
Views: 51
Reputation: 466
It could be that the tag you're looking for doesn't actually have an underscore in it...
i.e. GUISpy generates this: "html tag:=TABLE"
but you're using "html_tag"
Try taking out the underscore.
table_desc("html tag").value="TABLE"
Upvotes: 1