Monday, March 16, 2015

QTP Nested Webtables

QTP Nested Webtables


You need to add the correct webtable to the OR. Go to OR click Add Object and then Click on one of the cells and you will see a object hierarchy of the below type

Browser
+--Page
+----WebTable
+--------WebTable
+----------WebTable
+------------WebElement

Now add the Last WebTable to the OR and then try the operations that you are trying to do 


Dim iRow  'find total number of rows in nested table
Dim iCol    'find total number of cols in nested table


For i=0 to iRow
  For j=0 to iCol

    if (Browser().Page().WebTable().ChildItemCount(i, j, "Image") > 0) Then
      iRequiredRow = i
      iRequiredColumn = j
      Exit For
    Next
Next


2 comments: