What is RPA Testing?
RPA is software. It goes through all the software development stages, including testing. RPA testing deals with issues that are typically discovered in production, but aims to do it as early as possible in the process.
Levels of RPA testing
Since RPA development goes through the regular software development stages, RPA testing is not at all different from software testing. There are four main levels: unit (component) testing, integration testing, system testing, and acceptance testing.
Components of Test Suite
Comprehensive Tools within the UiPath Test Suite and their Integration
Testing includes many tasks like running tests, making reports, handling requirements and problems, connecting with CI/CD, and doing exploratory testing. For successful testing, it's important to smoothly use many tools together.
The UiPath Test Suite has tools that work well together, helping testing work better and connect with test management and ALM tools.
Studio
It lets you make automated tests similar to creating RPA workflows.
It enables you to mimic user interactions and actions within the RPA process, allowing the creation of test cases that verify the accuracy and reliability of automated workflows.
It gives you a visual way to design test scenarios, set input data, decide expected results, and build the steps for running tests.
It also helps you debug and solve problems in test cases before using them.
Orchestrator
It enables seamless coordination between testing robots and test cases created in UiPath Studio.
In addition to running RPA workflows, you can use Orchestrator to make testing robots run test cases created in Studio. You can schedule this to happen or set it off with a CI/CD pipeline.
Orchestrator provides monitoring capabilities, allowing you to track the progress and results of test case executions in real-time.
Test Manager
You can use a web application hosted by the Test Management Hub to manage your testing process effectively. This application focuses on the following functions:
- You can link automated test cases in Studio to manual test cases in Test Manager.
- Assign test cases to specific requirements.
- Access reporting and dashboards for a rapid view of your test outcomes.
- Conduct manual testing.
- Generate defects directly from test results.
- Include documentation for manual test cases using Task Capture.
Testing Robots
It executes the test cases.
Introduction to Test Cases
UiPath Test Suite offers a complete solution for RPA testing during automation development, as well as during integration and before moving it into production. Depending on the deployment model, RPA testing can be integrated in a continuous integration environment.
But the first goal of RPA testing—at least chronologically—is to address application issues and automation issues as early as possible, in the RPA development phase.
Test Cases are one of the features in Studio that enable you to test your automations as you develop them.
The structure of a test case
The easiest way to create an RPA test case is to right-click a workflow in the Project panel and choose "Create Test Case". The test case thus created will have the behavior-driven development structure.
RPA will generate new workflow with below containers:
... Given (Test Data)
... When (RPA Workflow)
... Then (Check Activites)
The verification activities
These activities are meant to be used in the Then block, to verify the outcomes of a test case execution.
Verify Expression
This activity verifies a single expression (e.g. whether two variables are equal). Its outcome can be True or False.
Verify Expression with Operator
This activity compares the outcomes of two expressions, variables or arguments using six predefined operators. Its outcome can also be True or False.
Verify Control Attribute
This is the most versatile activity in the Testing Activities Package. It allows the comparison of a property returned by another Activity with an expression, variable or argument. Its outcome can also be True or False.
Verify Range
This activity verifies whether an expression exists within a specified range. You must insert the expressions to be tested in their respective property fields
Test Data Management
Test data management is the process of managing the necessary data for fulfilling the needs of Testing. Data is basically what triggers the business rules, therefore data drives any sort of testing. In order to fulfill all the testing needs, we need to design the right data, provision it, and then consume it.
Benefits of Test Data Generation
- Increased test coverage.
- No data regulations.
- Easy to reproduce.
- The data can be stored in Excel/CSV files and even in Orchestrator.
Data-driven Test Cases
Basic vs. data-driven test cases
Basic test cases run with a single set of data, and typically verify the outcomes against static values. To test an RPA workflow in different scenarios, data-driven testing is used. Data-driven testing allows you to test your RPA workflows and applications to make sure that the automations can handle multiple scenarios.
A basic test case can be easily converted to a data-driven test case by adding the file with the data variations. When doing so, arguments are automatically created with the names of the columns in the data variation file.
Mock Testing
Automation projects often deal with business applications lacking a separate non-production environment. In such cases, testing the RPA workflows during development can become risky, through the effects in production, or costly, through the special resources needed.
Mock testing, or mocking, offers a way of replacing dependencies by creating objects that simulate the behavior of real objects. These objects are typically out of scope for the testing effort, at least in the unit testing stages.
Navigating the Test Explorer Panel in UiPath Studio
About Test Explorer
The Test Explorer panel displays information related to test automation. You can utilize Test Explorer and its sub-panels to group tests, perform debugging, and analyze descriptor coverage.
You will find all test cases and workflows listed within your test automation project. For example, if you have a data-driven test case, it shows up collapsed by default, with the number of variations placed under parentheses.
Working With Test Explorer
Using the Test Explorer toolbar, you have the ability to filter test results based on the result state, displaying only relevant information. Moreover, you can utilize various options to rerun the test cases.
Managing Test Data
You have the option to utilize the contextual menu for adding, updating, and removing test data from your test cases."
RPA Testing Best Practices
Modularity in your automation project
Good testing starts well before the test cases. An automation project should be broken down in atomic workflows, each of them having a single purpose and the smallest possible number of actions.
This way, it will be easy to understand and unit-test it.
Modularity in your test cases
A test case should have one purpose and ideally contain one verification. On the other hand, every feature should have a unit test. If there are exceptions, create separate test cases for each of these.
Clean structure
Test cases created from workflows have the Given-When-Then structure. You can use other structures or frameworks, but make sure you keep it clean.
If the Given block becomes too cumbersome, it might be a sign that the workflow you are trying to unit-test should be more atomic.
Autonomy
Test cases should be autonomous, meaning that one test case should not depend on another test case's run.
Mocking
Use mocking whenever there are complex steps irrelevant to the purpose of the test case.
Keep test cases up to date
Update the test cases with each change request.
Reusability
If there are test cases relevant for other automation projects, use the Import Test Case feature in Studio. If you need to rename the test cases, do it only in Studio, not outside.
After unit testing
If your development model is configured for Continuous Integration/Continuous Deployment, include the test cases in the CI/CD pipeline.
Prepare an RPA test set that can be run by the IT team in the pre-production environment, whenever there's an environment change. On the other hand, run the test set whenever you commit a change to your automation project.
Workflow Analyzer
Use Workflow Analyzer to ensure projects meet high quality and reliability standards. It uses a set of rules to check for various inconsistencies unrelated to project execution.
Source: UiPath Academy
Comments
Post a Comment