What is a web table object?
Tables are one of the primary design tools for HTML documents. Tables allow for greater control over page layout, allowing creation of more visually interesting pages. Tables are also used to set apart sections of documents, such as in sidebars, navigation bars, or framing images and their titles and captions. Tables have literally changed the look of the Web page. Originally, tables let people present data in a column format. Designers quickly figured out ways to improve the layout of their pages using tables.
A Sample Web Table Object
Every web table contains data (text data) and child objects in specified cells. When we are working with descriptive programming using QTP, web table object is very useful to get data or to get object information for further activities.
Retrieving data from web table
Step1:- Get row count from table
Step2:-Using “For Loop” Get column count for every row.
Using this row number and column number we can able to identify the cells in a table. To get data from a cell we have to provide row and column numbers of a cell.
Step3:-Get cell data from every cell by providing row and column.
Accessing child objects from web table
This example is to access web table child objects using description object. This is a common method to get child objects from any parent level object. Not like other objects web table object is having a special method to get child items from web table cell without using description object.
Accessing child objects from web table cell
This example to access child objects from web table cell. This method doesn’t require description object support to access child objects from web table. For this we are using Childitem method.
Difference between childobject, childitem and Getcelldata methods
ChildObjects method is to access total child objects from web table object using description object.
Syntax:- object.ChildObjects ([Description])
ChildItem method is to access child objects from a web table cell in web table object without using description object.
Syntax:-object.ChildItem (Row, Column, MicClass, Index)
Getcelldata method is to retrieve data from a web table cell in web table object.
Syntax:-object.GetCellData (Row, Column)