Configuring result count assertions
You can configure assertions to compare the number of items returned in a page list, page group, value list, or value group on the data page to the result that you expect to see on the clipboard.
- Optional: If the data page unit test case is not already open, open the data page unit test case.
- Click the Definition tab.
- Complete one of the following steps.
- To add a new assertion, click Add expected result.
- Modify an existing assertion on the tab.
- From the Assertion type list, select Result count.
- In the of object field, enter the path of the object with which the results are compared or counted against during the assertion. You can only use the .pxResults property in this field. When the assertion runs, you can compare its results with.pxResults, which contains the results obtained by running the data page.
- Optional: In the Filter field, enter a property and value on which to filter results or click the Expression Builder icon to provide an expression that is used to filter results. The list assertion applies only to the page list entries that are specified for this filter value.
- Select the appropriate comparator from the Comparator list.
- In the Value field, enter the value that you want to compare with the object.
- To add a comment, click the Add comment icon.
- Click Save.
The assertion fails if the expected value does not match the length of the page list, page group, value list, or value group.
Open topic with navigation