Skip to main content


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

Configuring page assertions

Updated on April 8, 2022

Some rules, such as activities and data transforms, can create or remove pages from the system. You can create page assertions to determine whether or not a page exists after a unit test case runs. You can also assert if a property has an error and, if it does, what the message is so that you can validate that the message is correct.

You can configure page assertions for embedded pages, data pages, data pages with parameters, and embedded pages within data pages that either have or do not have parameter stop-level pages.

Before you begin: Open the unit test case. For more information, see Opening a unit test case.
  1. On the bottom of the Definition tab, click Add expected result.
  2. In the Assertion type list, select Page.
  3. In the Page field, enter the name of the page.
  4. In the Comparator list, select the comparator that you want to use to compare the property with a specified value:
    • To ensure that the page is created after the unit test runs, select exists. The assertion passes if the system does not find the page.
    • To ensure that the page is removed after the unit test runs, select does not exist. The assertion passes if the system does not find the page.
    • To ensure that the page has an error after the unit test runs, select has errors. The assertion passes if the system finds errors on the page.
    • To ensure that the page is free of errors after the unit test runs, select has no errors. The assertion passes if the system finds no errors on the page.
    • To ensure that the page has a specific error message after the unit test runs, select has error with message and then enter the message in the Value box or click the Gear icon to build an expression. The assertion passes if the page contains the complete error message.
    • To ensure that the page has a portion of an error message after the unit test runs, select has error message that contains and then enter the message in the Value box or click the Gear icon to build an expression. The assertion passes if the page contains the words or phrases in the error message.
  5. Optional: To add another page to the assertion, click Add pages, and then perform steps 3 through 4.
  6. Optional: To add a comment, click the Add comment icon, enter a comment, and then click OK.
  7. Click Save.
For example: An activity runs every week to check the last login time of all operators and deletes any operator record (page) from the system if the last login was six months ago. When you test this activity, you can:
  1. Set up the clipboard to load an operator page that has the last login time as six months ago.
  2. Create a page assertion that ensures that the page no longer exists after the activity runs.
  • Page assertions

    You can configure page assertions to determine if a page exists on the clipboard or if a page has errors.

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