Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting WebTable Count
#1
Not Solved
Hello All,

I am quite new to QTP. The question that I have is, if I have like 100 webtables in a page/frame, and I want to get the total count of these webtable via code, how to do accomplish that?

My goal is to iterate over all the webtables, and for each webtable, I want to print the data (I am just trying to simplify the task for now).


In other words,
Code:
totalWebTables = Browser("").Page("").Frame("").WebTable.GetCount(???)

for i = 1 to totalWebTables

msgbox Browser("").Page("").Frame("").WebTable(i).RowCount
Next

Thanks. Kindly let me know if this doable.

AKapoor
Reply
#2
Not Solved
You will have to get the frame's childobjects as the webtable. Learn more about childobjects method. Search this forum and you will slide through.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#3
Not Solved
Thanks for your reply. Webtables are already frame's childobjects. But I am still not too sure, as to how to get this to work.
Reply
#4
Not Solved
Since you are not intrested to search and learn, i will logically guide you till the tunnel and then let you survive Smile

Try this,
Code:
Set oWebtable = Description.Create()
oWebtable("micclass") = "Webtable"
oWebtable("html id") = "spy and enter the html id"

Set oChildObjects = Browser("").Page("").Frame("").ChildObjects(oWebtable)
msgbox oChildObjects.count
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  WebTable..Row and Column Count Brian T. 10 73,121 03-16-2012, 04:45 PM
Last Post: Teju
  Newbie: How do i count through a webtable to find an entry? jove1776 5 4,703 08-27-2010, 08:05 PM
Last Post: supputuri
  Diff. between page checkpoint link count and childobj count anemuday 0 2,245 07-20-2008, 10:11 PM
Last Post: anemuday

Forum Jump:


Users browsing this thread: 2 Guest(s)