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.
An RPA Testing file can be created by invoking a workflow from the project. Right-click a workflow in the Project panel and select Create Test Case or Data Driven Test Case:
You can 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. For more information, see Mock Testing.
A test case
.xaml is created invoking the workflow and having three additional 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.
To check the workflow's activity coverage, debug the newly created test case and view covered and uncovered test cases in the Activity Coverage panel.
When performing this action in our example, we received the following coverage:
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. We 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 our workflow, we decided to use a separate set of data to test out all activities. Therefore, we imported data from a
.csv file and used 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.
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 5 months ago