Subscribe

UiPath Studio

The UiPath Studio Guide

RPA Testing

Overview


RPA Testing is designed for testing workflows directly and viewing the activity coverage during execution. Such testing processes ensure that execution is performed and all corner cases are covered, regardless of the decisions taken during execution.

Dependencies


Testing Activities Packge

Create Test Case


You can create a test case by invoking a workflow from an existing project.

  1. Open your workflow in Studio.
  2. In the Projects panel, right-click the workflow and choose Create Test Case.
  1. Select Mock workflow under test when you create your test case if you want to make a copy of your workflow where you can mock specific activities. If you have an existing mock file that you want to use, you can select it from the Mock dropdown. For more information, see Mock Testing.
  1. Click Next if you want to add test data.
  2. Click Create to confirm changes.
    A test case XAML file is created invoking the workflow with the following containers: Given, When, and Then. The file is invoked inside the Invoke Workflow File activity, part of the When container.

Arguments from the workflow are automatically imported. To view or add more arguments, click the Import Arguments button part of the Invoke Workflow File activity.

👍

Additional actions

Activity Coverage


You can use the workflow activity coverage panel to check whether your test cases have been covered or not.

Activity Coverage Example

Consider the coverage of the following workflow:

According to the message, this test case covered only 53% of the activities from the workflow. Depending on your automation needs, you can create separate test cases to cover each scenario during the execution. For example, the above flowchart uses a Flow Switch activity. You can then create another test case to follow the execution of another scenario, like in the case of low-volume loans.

Another way would be to create one test case to cover all the sections of the workflow. For this workflow, a separate set of data was used to test out all activities. Therefore, i used imported data from a CSV file and a For Each activity to pass it through each activity in the workflow:

When debugging, a 100% activity coverage rate was reached meaning that the data set used in the test case, together with the added activities covered all possible scenarios in the project.

Examining Activity Coverage

To assist your workflow debugging, you can see the traversed path, by opening the Activity Coverage panel and double-clicking the test case. You can see the path highlighted in green and any skipped activities in red. Additionally, you can quickly identify whether a test case has passed passedpassed or failed failedfailed and view the result.

📘

Note

You can examine test results only for test cases that include verification activities:

Publish Test Cases


Test cases are packaged only if they are Set as Publishable. In the Project panel, right-click a test case and select Set as Publishable. Read more about setting test cases as publishable here.

Publishing is performed by clicking the Publish or Publish Test Cases ribbon options:

  • Publish - publishes the whole project together with test cases;
  • Publish Test Cases - publishes the project as a test case to be managed from Orchestrator's Test Cases page.

Updated 7 days ago


RPA Testing


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.