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.
You can create a test case by invoking a workflow from an existing project.
- Open your workflow in Studio.
- In the Projects panel, right-click the workflow and choose Create Test Case.
- 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.
- Click Next if you want to add test data.
- Click Create to confirm changes.
A test case
XAMLfile 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.
You can use the workflow activity coverage panel to check whether your test cases have been covered or not.
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.
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 or failed and view the result.
You can examine test results only for test cases that include verification activities:
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