➤ Defining a Data Table Parameter
In the previous lessons, you reserved a flight from New York to San Francisco. New York is a constant value, which means that New York is the departure city each time you run the test. In this exercise you will make the departure city a parameter so that you can use a different departure city for each test run.
1 Start QuickTest and open the Checkpoint test.
If QuickTest is not already open, choose Start > Programs > QuickTest Professional > QuickTest Professional.
➤ If the Welcome window opens, click Open Existing.
➤ If QuickTest opens without displaying the Welcome window, choose
File > Open or click the Open button.
In the Open Test dialog box, locate and select the Checkpoint test, then click Open.
2 Save the test as Parameter.
Select File > Save As. Save the test as Parameter.
3 Confirm that the Active Screen option is enabled.
If you do not see the Active Screen at the bottom of the QuickTest window, click the Active Screen button, or choose View > Active Screen.
4 Confirm that the Data Table option is enabled.
If you do not see the Data Table at the bottom of the QuickTest window, click the Data Table button, or choose View > Data Table.
5 Select the text to parameterize.
In the Keyword View, expand (+) Action1 > Welcome: Mercury Tours > Find a Flight: Mercury.
In the fromPort row in the Keyword View, click in the Value cell and then click the parameterization icon (<=>). The Value Configuration Options dialog
box opens.
1 Start QuickTest and open the Checkpoint test.
If QuickTest is not already open, choose Start > Programs > QuickTest Professional > QuickTest Professional.
➤ If the Welcome window opens, click Open Existing.
➤ If QuickTest opens without displaying the Welcome window, choose
File > Open or click the Open button.
In the Open Test dialog box, locate and select the Checkpoint test, then click Open.
2 Save the test as Parameter.
Select File > Save As. Save the test as Parameter.
3 Confirm that the Active Screen option is enabled.
If you do not see the Active Screen at the bottom of the QuickTest window, click the Active Screen button, or choose View > Active Screen.
4 Confirm that the Data Table option is enabled.
If you do not see the Data Table at the bottom of the QuickTest window, click the Data Table button, or choose View > Data Table.
5 Select the text to parameterize.
In the Keyword View, expand (+) Action1 > Welcome: Mercury Tours > Find a Flight: Mercury.
In the fromPort row in the Keyword View, click in the Value cell and then click the parameterization icon (<=>). The Value Configuration Options dialog
box opens.
6 Set the parameterization properties.
Select the Parameter radio button. This lets you replace the constant value (New York) with a parameter.
Confirm that the DataTable option is selected. This means that the value of the parameter will be taken from the QuickTest Data Table.
The Name box is enabled and displays p_Item. Change this to departure.
Select the Parameter radio button. This lets you replace the constant value (New York) with a parameter.
Confirm that the DataTable option is selected. This means that the value of the parameter will be taken from the QuickTest Data Table.
The Name box is enabled and displays p_Item. Change this to departure.
Click OK to close the dialog box. QuickTest adds the departure parameter to the Data Table as a new column and inserts New York in the first row under it. New York will be the first of several departure cities that QuickTest will use during test runs of the application.
Note the change in the step’s appearance in the Keyword View. Previously, the step was displayed as fromPort Select New York. Now, the step is displayed as fromPort Select DataTable(“departure”, DTGlobalSheet). When you click the Value cell, the following information is displayed, indicating that the value is parameterized using a Data Table parameter called departure:




No comments:
Post a Comment