Skip to main content


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

Unit testing a harness

Updated on January 14, 2022

After you create a harness rule, you can run the rule to test it in the context of the application you are developing. Specify a test page for the rule to use, provide sample data as the input, run the rule, and examine the results.

Before you begin: Create and open the harness rule that you want to test. For more information, see Creating harnesses. Determine how you will provide the sample data to use when testing the rule. If possible, open a work item of the appropriate class.
  1. In the navigation pane of Dev Studio, click RecordsUser interfaceHarness, and then select the harness you want to test.
  2. Click ActionsRun. The Run Rule window opens.
  3. In the Test Page pane, select the context and test page to use for the test.
    1. In the Data Context list, select the thread in which you want to run the rule. If a test page exists for the thread, then it is listed and can be used for creating the test page.
    2. Select the test page to use for the test:
      • Select Empty test page to start from a page containing no parameter values.
      • If a clipboard page exists, then you can select Copy existing page to copy values from a thread of an existing clipboard page to the main test page.
      • Select Create or reset test page to create a new test page or reset the values of an existing test page.
  4. To apply a data transform to values on the test page, click the link in the Apply field, and then select a data transform.
  5. In the lower section of the Run Rule window, enter the test data and click Execute.
    The system runs the harness and displays the results.
  6. To convert the test into a Pega unit test case, click Convert to Test. For more information, see Viewing test coverage reports.

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