You are here: Data creation and management > Data page testing > Assertions > Configuring result count assertions

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.

  1. Optional: If the data page unit test case is not already open, open the data page unit test case.
  2. Click the Definition tab.
  1. Complete one of the following steps.
  2. From the Assertion type list, select Result count.
  3. 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.
  4. 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.
  5. Select the appropriate comparator from the Comparator list.
  6. In the Value field, enter the value that you want to compare with the object.
  7. To add a comment, click the Add comment add comment icon icon.
  8. 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.