You are here: Data creation and management > Data page testing > Assertions > Configuring unordered list assertions

Configuring unordered list assertions

You can create unordered list assertions for page lists on a data page to determine if the expected result is anywhere in the list of results returned by that data page. Even if the order of results changes, the test will continue to work.

  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.
  3. Complete one of the following steps:
  4. From the Assertion type list, select List.
  5. From the Appearances list, select In ANY instance.
  6. In the of object field, enter the path of the object with which the results are compared or counted against when the assertion runs. For example, when the assertion runs, you can compare its results with .pxResults, which contains the results that obtained from running the data page.
  7. 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.
  8. Add properties to unordered list assertions.
  9. Click Save.

When you run the data page unit test, the system searches for the specified properties in the page list. The assertion passes if the all the properties in the set match the expected values in the page list.

If all the properties do not match any of the values in the page list, the assertion does not pass.