Data drive array checkpoints
Relevant for: API testing only
This task describes how to set checkpoints for elements of an array through data driving.
Enable active content on your computer
-
In Internet Explorer, select Tools > Options.
-
Select the Advanced tab.
-
Enable the option Allow active content to run in files on My Computer in the Security section.
-
Click OK and close the browser.
Add a step with an array output
Add a test step with output properties in the form of an array.
Data drive the array
-
In the Properties pane, open the Input/Checkpoints tab .
-
In the Checkpoints area, use the plus button . in the row of the parent node, to add an array element.
-
Provide property values. These values are transferred to the Data pane during data driving. If you do not provide data, include the array element by selecting the triangle icon in the parent node.
-
Select the array's parent node and click the Data Drive button .
-
In the Data Driving Dialog Box, select Only Input, Checkpoints or Both Input and Checkpoints as a Data Driven Section option.
-
Click OK. The data driving mechanism informs you that it succeeded.
Set the evaluation expression
In the Properties pane, adjacent to the data driving expression, select an evaluation operator, such as = or <.
Provide data for the array
-
After you data drive an array, you do not set property values from the Checkpoints pane. Instead, you edit the table in the Data pane. In the Data pane, click the node in the left pane, corresponding to the array element that is to be validated.
-
In the <array_name> and MainDetails tables, enter the iteration number to which to checkpoint should be applied in the MainDetails column. A "1" indicates the first iteration. If you have several columns with "1" as the iteration number, the checkpoints will be validated against all of those values.
Select an array validation method
In the Input/Checkpoints tab, expand the drop down adjacent to the name of the parent array node. Select one of the following:
Fixed. | Checks that each of the returned array elements matches the corresponding array element in the data table in the Data pane. Each array is marked by an index number, as it checks the arrays by their index. |
All. | Checks that all of the returned array elements match the array element in the Data pane. In this mode, arrays are not marked by an index number. For example, if a property in the first array is marked >= 2 and the same property in another array element is set to <=10, the test run will check that all returned values are between 2 and 10. |
Contains. | Checks that at least one of the returned array elements matches the value of the property in the Checkpoints pane. In this mode, arrays are not marked by an index number. |
Set the number of iterations - optional
-
Select the Test Flow or Loop box in the canvas.
-
In the Properties pane, open the Input/Checkpoints tab.
-
Set the number of iterations for the test run.