Datasheet Handling in Data driven Testing4 - QTP

QTP Datadriven testing : Parameter in Datasheet programming :

A parameter (column) in a sheet in the run-time Data Table. This object is not a built-in utility object, but can be accessed using one of the following methods:

    * DTSheet.AddParameter
    * DTSheet.GetParameter

      Note: All methods performed on this object apply to the run-time DataTable object only. Changes to the run-time DataTable object are reflected in the test results, but the design-time Data Table is not affected.

Associated Properties

    * Name Property
    * RawValue Property
    * Value Property
    * ValueByRow Property


The following example uses the AddParameter method to create the new Parameter, "Arrival" within the new sheet, MySheet of the run-time Data Table, and sets the first cell in the column as "New York". Because the method also returns the newly created parameter, it is possible to use methods or check properties of the new sheet within the same statement.

ParamName=DataTable.AddSheet("MySheet").AddParameter("Arrival", "New York").Name

Note that if a parameter with the name "Arrival" already exists in the sheet, the example above will return "Arrival1" as the actual name assigned to the new parameter.

The example below performs the equivalent of renaming a column (parameter) in the DataTable by copying the data from one column to a new column with a new name, and then deleting the old column.

'add a new column
DataTable.GetSheet("dtGlobalSheet").AddParameter "NewColumn","Row1Value"

'copy the cells from the old column into the new column
For i=1 to cnt

'delete the old column

GetParameter  Example

The following example uses the GetParameter method to return the "Destination" parameter from the run-time Data Table sheet: MySheet.


Name  Example

The following example uses the Name method to return the name of the newly created parameter in the run-time Data Table and writes it in the report.

Dim paramname

paramname = DataTable.LocalSheet.AddParameter("Food", "pizza").Name

Reporter.ReportEvent 1, "The New Parameter name is", paramname

RawValue  Example

The following example uses the RawValue property to find the formula used in the current row of the Date column in the ActionA sheet of the run-time Data Table. The statement below returns the value: =NOW()


Value Example

The following example uses the Value property to set the value in the current row of the Destination parameter (column) in the "ActionA" sheet of the run-time Data Table.

DataTable.GetSheet("ActionA").GetParameter("Destination").Value="New York"

Note: You could omit the word Value in the statement above, because Value is the default property for the DTParameter object.

Example ValueByRow

The following example uses the ValueByRow property to find the value in the 4th row of the Destination parameter (column) in the "ActionA" sheet of the run-time Data Table.



  1. The big data record cannot be easily handle by the person who is not extra ordinary in the managing of data by following the right technique for managing the data everyone can easily mange it but this techniques only knows by those person who are the data scientist, so if you want to get the data scientist for solving up your data problem than this is here for you.

  2. The work of writing is not easy for everyone because the writing needs the proper attention for your mind and you should have the proper grammatical skills for writing the best content. So here are some best places available in the market form where you can get the custom writing services for your education, work, and business.