Parameterization in QTP with example

Parameterization is the process of replacing fixed values with parameters, by replacing fixed values with parameters Quick Test enables user to enlarge the scope of a basic test and increase the power and flexibility of the test, A parameter Is a variable that is assigned a value from an external data source or generator, Values in steps and checkpoints and also the values of action parameters can also be parameterized.

Step 1:

Take an example of Flight Reservation Application and record only Open order section with specifying order number as “1”

QTP Expert view will show the Script like below.

QTP Script before parameterization

Window(“Flight Reservation”).WinMenu(“Menu”).Select “File;Open Order…”

Window(“Flight Reservation”).Dialog(“Open Order”).WinCheckBox(“Order No.”).Set “ON”

Window(“Flight Reservation”).Dialog(“Open Order”).WinEdit(“Edit”).Set “1”

Window(“Flight Reservation”).Dialog(“Open Order”).WinButton(“OK”).Click

Window(“Flight Reservation”).Activate

Parameterization -QTP

Step 2:

Select Data driver to parameterize the value, To open the data driver window, Select Tools->Data Driver (Make sure you stopped the recording), Data Driver Window opens, It contains all the values used in the script

Parameterization -data driver

Step 3:

Select the Value to be parameterized in Data Driver Dialog, and click parameterize button

Step 4:

Select parameterization type window opens, It contains two types

Different types of parameterization in QTP are

Step by Step parameterization (For step by step parameterization, It’s a default one)

Parameterize all; Select either one type (To parameterize all values)

Parameterization -Data driver wizard

Step 5:

Select Step by step parameterization method, after selecting  “parameterize the selected step” window opens, in that window select the item to be parameterized.

Step 6:

Make sure that the “Parameter” radio button is clicked in the “Configure Value Tab” is selected, using modify icon user can change the data table values.

Parameterization -data driver step

Step 7

“Parameter Option” window opens when the modify icon is clicked, where name of the parameter can be changed, then click “OK” button

Step 8:

After finishing the process of parameterization, the script will look like as the one given below and the data table contains the parameterized column name, in this table, multiple set of inputs to be parameterized can be given under the specific column name

QTP Script After parameterization

Window(“Flight Reservation”).WinMenu(“Menu”).Select “File;Open Order…”

Window(“Flight Reservation”).Dialog(“Open Order”).WinCheckBox(“Order No.”).Set “ON”

Window(“Flight Reservation”).Dialog(“Open Order”).WinEdit(“Edit”).Set DataTable(“DataTable1_param_dtGlobalSheet”, dtGlobalSheet)

Window(“Flight Reservation”).Dialog(“Open Order”).WinButton(“OK”).Click

Step 9:

Add the values in the data table, By default it shows “1” in first column, Add 2,3,4 in next columns

parameterization-Keyword view

Step 10:

Run the Script, Now for each iteration, QTP will automatically pass a value given in the data table to the parameter used in the script.

Step 11:

View the results

1 thought on “Parameterization in QTP with example”

Leave a Reply

Your email address will not be published. Required fields are marked *