Parameterizing an Action
If you look at the Data Table at the bottom of the QuickTest window in the ActionB test, you will see four tabs: Global, Copy of FlightOrder, Sign_in [ActionA], and ReturnHome [ActionA].
Note: If the Data Table is not displayed, choose View > Data Table to display it, or click the Data Table button .
The Global tab is a data sheet whose data is used for the entire test. If five rows of data are displayed in the Global table, the test will run five times. In addition, you can create data sets for each action, using the relevant action sheet. If you parameterize a step using an action parameter and enter five rows of data in the corresponding sheet, you can define that action to run five times within each test iteration.
Note: The Sign_in [ActionA] and ReturnHome [ActionA] data sheets are displayed in gray and cannot be edited because each of these data sheets belong to the corresponding called action and can be edited from the called action's original test only.
In this section, you will create a data set for the FlightOrder action to check how the application handles multiple orders during a single user session.
Open the ActionB test.
If the ActionB test is not already open, choose File > Open and browse to ActionB. Click Open.
Select a step to parameterize.
Expand Copy of FlightOrder > Welcome: Mercury Tours > Find a Flight: Mercury.
In the toPort row in the Keyword View, click the Value cell and then click the parameterization icon . The Value Configuration Options dialog box opens.
Enter the parameter information.
Select Parameter and confirm that the DataTable option is selected.
In the Name box, type ArrivalCity.
You are creating this data set exclusively for the Copy of FlightOrder action. Therefore, select Current action sheet (local). Click OK to close the Value Configuration Options dialog box.
QuickTest automatically adds the ArrivalCity column to the Copy of FlightOrder data sheet and inserts San Francisco into the first cell of the ArrivalCity column.
Parameterize additional steps.It is not logical for a single customer to fly to two different locations on the same dates, so it makes sense to parameterize the departure and arrival dates.
In the fromMonth row in the Keyword View, click the Value cell and then click the parameterization icon . The Value Configuration Options dialog box opens. Select Parameter and confirm that the DataTable option is selected.
In the Name box, type fromMonth. Select Current action sheet (local) in the Value Configuration Options dialog box and click OK.
In the toMonth row in the Keyword View, click the Value cell and then click the parameterization icon . The Value Configuration Options dialog box opens. Select Parameter and confirm that the DataTable option is selected.
In the Name box, type toMonth. Select Current action sheet (local) in the Value Configuration Options dialog box and click OK.
Enter the parameterization data in the Data Table.
In the Data Table, click the Copy of FlightOrder tab.
Type Portland in the second row of the ArrivalCity column.
Type Oct in the second row of the fromMonth and toMonth columns.
Click an empty cell of the first or second row to save your changes.
Set the action to run all the data in the local Data Table.
By default, QuickTest only runs one iteration of each action in a test. You want QuickTest to use all the data in the Copy of FlightOrder tab.
Right-click the Copy of FlightOrder action in the Keyword View and choose Action Call Properties. The Action Call Properties dialog box opens.
Select Run on all rows in the Run tab. If a message box opens, read it and then click OK to close it. Click OK to close the Action Call Properties dialog box.
Save the test.Choose File > Save or click the Save button .
You have now created a test that signs in to the Mercury Tours site, submits two flight orders: a flight from London to San Francisco from Dec 29 to Dec 31, and a flight from London to Portland from Oct 29 to Oct 31, and then returns to the starting point of the test by clicking the Home link.
Note: If the Data Table is not displayed, choose View > Data Table to display it, or click the Data Table button .
The Global tab is a data sheet whose data is used for the entire test. If five rows of data are displayed in the Global table, the test will run five times. In addition, you can create data sets for each action, using the relevant action sheet. If you parameterize a step using an action parameter and enter five rows of data in the corresponding sheet, you can define that action to run five times within each test iteration.
Note: The Sign_in [ActionA] and ReturnHome [ActionA] data sheets are displayed in gray and cannot be edited because each of these data sheets belong to the corresponding called action and can be edited from the called action's original test only.
In this section, you will create a data set for the FlightOrder action to check how the application handles multiple orders during a single user session.
Open the ActionB test.
If the ActionB test is not already open, choose File > Open and browse to ActionB. Click Open.
Select a step to parameterize.
Expand Copy of FlightOrder > Welcome: Mercury Tours > Find a Flight: Mercury.
In the toPort row in the Keyword View, click the Value cell and then click the parameterization icon . The Value Configuration Options dialog box opens.
Enter the parameter information.
Select Parameter and confirm that the DataTable option is selected.
In the Name box, type ArrivalCity.
You are creating this data set exclusively for the Copy of FlightOrder action. Therefore, select Current action sheet (local). Click OK to close the Value Configuration Options dialog box.
QuickTest automatically adds the ArrivalCity column to the Copy of FlightOrder data sheet and inserts San Francisco into the first cell of the ArrivalCity column.
Parameterize additional steps.It is not logical for a single customer to fly to two different locations on the same dates, so it makes sense to parameterize the departure and arrival dates.
In the fromMonth row in the Keyword View, click the Value cell and then click the parameterization icon . The Value Configuration Options dialog box opens. Select Parameter and confirm that the DataTable option is selected.
In the Name box, type fromMonth. Select Current action sheet (local) in the Value Configuration Options dialog box and click OK.
In the toMonth row in the Keyword View, click the Value cell and then click the parameterization icon . The Value Configuration Options dialog box opens. Select Parameter and confirm that the DataTable option is selected.
In the Name box, type toMonth. Select Current action sheet (local) in the Value Configuration Options dialog box and click OK.
Enter the parameterization data in the Data Table.
In the Data Table, click the Copy of FlightOrder tab.
Type Portland in the second row of the ArrivalCity column.
Type Oct in the second row of the fromMonth and toMonth columns.
Click an empty cell of the first or second row to save your changes.
Set the action to run all the data in the local Data Table.
By default, QuickTest only runs one iteration of each action in a test. You want QuickTest to use all the data in the Copy of FlightOrder tab.
Right-click the Copy of FlightOrder action in the Keyword View and choose Action Call Properties. The Action Call Properties dialog box opens.
Select Run on all rows in the Run tab. If a message box opens, read it and then click OK to close it. Click OK to close the Action Call Properties dialog box.
Save the test.Choose File > Save or click the Save button .
You have now created a test that signs in to the Mercury Tours site, submits two flight orders: a flight from London to San Francisco from Dec 29 to Dec 31, and a flight from London to Portland from Oct 29 to Oct 31, and then returns to the starting point of the test by clicking the Home link.
Comments
Post a Comment