Skip to main content

Creating scenario tests

Pega Community logo

Note: The following content, referenced from Pega Community, is included here to help you better achieve the module learning objectives.

Record a set of interactions for a case type or portal in scenario tests. You can run these tests to verify and improve the quality of your application.

Before you begin: Create a test ruleset in which to store the scenario test. For more information, see Creating a test ruleset to store test cases.
  1. Launch the portal in which you want to do the test.

  2. Do one of the following to open the automation recorder:

    • In App Studio, on the lower-left side of the screen, click the Test icon.
    • In Dev Studio, on the lower-right side of the screen, toggle the run-time toolbar, and then click the Toggle Automation Recorder icon.
  3. In the Scenario tests pane, click Create test case, and then select the test type:

    • To record a test for a portal, select Portal.
    • To record a test for a case, select Case type, and then select the type of case for which you want to record the test.
      Note: When you select the case type, a new case of that type is created.
  4. Record the steps for the test by clicking the user interface elements.

    Note: When you hover over a testable element, an orange highlight box appears. When you click an element, you record an implicit assertion and add the interaction to the list of test steps.
  5. Optional:

    To add an explicit assertion to the test, do the following tasks:

    1. Hover over an element.

    2. Click the Mark for assertion icon on the orange highlight box.

    3. In the Expected results section, click Add assertion.

    4. Define the assertion by completing the Name, Comparator, and Value fields.

    5. Click Save step.

  6. To delay the execution of a step, do the following tasks. You can delay the execution of a step to add latency to a web browser and actions on a web page to prevent tests from failing when there is complex processing or slow UI rendering.

    1. Click the Mark for assertion icon on the orange highlight box.

    2. In the Wait field, enter the number of milliseconds by which to delay the execution of the step.

    3. Click Save step.

      Note: To add delays to all steps in all scenario tests in your application, follow the procedure in Delaying scenario test execution.
      Note: Delaying the execution of a single step takes precedence over delaying all of the steps at the application level.
  7. When you finish adding steps, in the Test case pane, click Stop and save test case.

  8. On the New test case form, save the test:

    1. Enter a name and a description for the test.

    2. In the Context section, select a branch or ruleset in which you want to save the test.

    3. In the Apply to field, enter the name of a class that is relevant to the test.

    4. Click Save.

    Note: The test case appears on the Scenario testing landing page.

  • Updating scenario tests
  • Application: Scenario testing landing page

    The scenario testing landing page provides a graphical test creation tool that you can use to increase test coverage without writing complex code.

If you are having problems with your training, please review the Pega Academy Support FAQs.

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 Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice