Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

This content has been archived and is no longer being updated.

Links may not function; however, this content may be relevant to outdated versions of the product.

Data page unit test case assertions

Updated on September 10, 2021

Data page unit test cases help to validate that application data is loaded correctly. You configure assertions that define the expected output of the test. When the test runs, the expected result is compared with the actual results on the data page.

Assertions are applied in the order you that you define them. All assertions, except for run-time assertions, must pass for the test to be successful.

In addition to property and expected run-time assertions, you can create ordered list, unordered list, and result count assertions.

Expected run-time assertions

After you create a data page unit test case, the system generates the expected run-time assertion. The default value of the assertion is the time taken by the data page to fetch results when the test was first run. The system compares this time with the run time of any future tests. You can change this value or create additional assertions.

An actual run time that is significantly longer than the expected run time can indicate an issue, such as a connectivity issue between the application and database from which you are obtaining initial results.

Expected run-time assertion

Expected run-time assertion

Property assertions

You can configure property assertions to compare the expected value of one or more properties with the actual values on the data page.

In the following example, you can verify that the .pxMaxRecords property, which appears only once on the data page, is equal to 500.

Property assertion

Property assertion

Ordered list assertions

You can create ordered list assertions for a page list on the data page to apply assertions to all results returned by the data page so that you do not have to manually create assertions for each result in the list.

The following example shows the results that are obtained when the assertion runs are compared with the .pxResults property. This property contains the list of results that are obtained by running the data page. In addition, the assertion applies only to the data page entries that are specified for the filter value (when the Department is Engineering).

Ordered list assertion

Ordered list assertion

Unordered list assertions

You can create unordered list assertions for a page list on the data page. These assertions determine whether the expected result is anywhere in the list of results returned by the data page.

In the following example, you can verify that the data page results contain an entry where Experience Required is equal to the value of 6, regardless of where the Experienced Required property appears in the data page.

Unordered list assertion

Unordered list assertion

Result count assertions

You can configure assertions to compare the number of items that are returned in a page list, value list, or value group on the data page with the output that you expect to see on the clipboard.

In the following example, the result count assertion verifies that the number of returned results is greater than 7.

Result count assertion

Result count assertion

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us