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.

Create and execute test cases for decision tree and decision table rules

Updated on September 10, 2021

Summary

You can unit test an individual rule on its own before testing it in the context of the entire application you are building. With Automated Unit Testing, you can save the test data that you use as test case rules. Then, the next time you test that rule, you can run the test case rather than manually re-entering the test data.

Suggested Approach

Creating Test Cases for Decision Trees and Decision Tables

To record and save a test case:
  1. Open the decision tree or decision table rule you want to test.
  2. Click the Run toolbar icon. The Run Rule window appears.
In V6.1, steps two and three are different. To create a test case for a decision tree or decision table in V6.1:
  1. Go to the Test Cases tab of the opened rule.
  2. Click Record New Test Case. The Run Rule window appears.

Starting with step 4, the rest of the steps for creating a test case are the same for V6.1.

  1. In the Test Page section, specify which page to use as the main page.
  2. In the Result section, enter the test data and click Run Again.
  3. Examine the results and determine whether the test data used generated the expected results.

zzz

  1. When you are satisfied with the results, click Save Test Case . The New Test Case dialog box appears.
  2. Enter the name of the test case, a short description, and the appropriate RuleSet and version; then click Create.

Running Test Cases

After you create a test case for a rule, it appears in the list of saved test cases in the Run Rule window for the tested rule.

To run a test case:
  1. Open the rule you want to test.
  2. Click the Run button. The Run Rule window appears.
In V6.1, steps 2 - 4 for running a test case are different. After you create test cases for a rule, they appear on the Test Cases tab for that rule.
To run a test case in V6.1:
  1. Go to the Test Cases tab of the opened rule.
  2. Click the name of the test case.

    The Run Rule window appears, with the name of the test case already selected. The system runs the test case, and displays the results in the Result section of the window. If any differences are found, a message states that the results are unexpected.

Step 5 in this article is the same for V6.1.

  1. Select the run against a saved test case option and choose a test case from the list.

zzz

Because the test case rule contains the initial pages that were created, loaded, or copied before the rule was run, you do not have to recreate the initial conditions before running the test case.

  1. Click Run Test Case. Process Commander runs the test case and displays the results in the Result section of the Run Rule window. If there are any differences found, a message states that the results were unexpected.
  2. Click Save Results to save the descriptions of any differences found between the current results and those stored in the test case.

zzz

In the case of unexpected results, you can examine the rule history of the rule by clicking View Rule History.

Additionally, if the new results are valid, you can overwrite the test case so it uses the new information by clicking Overwrite Test Case.

Related Topics

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