QTP - Datatables



A DataTable, similar to Microsoft Excel, helps the testers to create data-driven test cases that can be used to run an Action multiple times. There are two types of Datatables −

  • Local DataTable − Each action has its own private datatable, also known as local datatable, which is can also be accessed across actions.

  • Global DataTable − Each test has one global data sheet that is accessible across actions.

The data sheet can be accessed from the "Data" Tab of QTP as shown below −

Data Table in QTP

To execute a test case for some specified number of iterations, one can set the iterations of global datatable in the Test Settings dialog, that can be accessed using File → Settings → Run(Tab) as shown below −

Data Table in QTP

Example

For example, if a user wants to parameterize "compound Interest" of http://easycalculation.com/ that can be accessed using http://easycalculation.com/compound-interest.php. The Parameters can be created as shown below. Most of the functionalities of Excel can be used in Data table as well.

Data Table in QTP

DataTable Operations

There are three types of objects to access DataTable. DataTable operations can be well understood by traversing through the following −

Sr.No. Object Type & Description
1 Data Table Methods

Gives detailed information about the data table methods.

2 DTParameter Object Methods

Gives detailed information about the DTParameter methods.

3 DTSheet Object Methods

Gives detailed information about the DTSheet methods.

Advertisements