Test Automation is a testing technique that performs using special automated testing software tools (i.e. Selenium, Appium, UiPath, etc.) to execute a test case suite. The automation testing tool can also enter test data into the System under Test, compare expected and actual results and generate detailed test reports. With this, UiPath is bringing a complete suite of functional testing solutions under one single offering.
Regression Testing: Regression Testing is a Software Testing type in which test cases are re-executed in order to check whether the previous functionality of the application is working fine and the new changes have not introduced any new bugs. Regression means retesting the unchanged parts of the application. Regression test is like a verification method. Test cases are generally automated as test cases are required to execute again and again and running the same test cases again and again manually is time-consuming and tedious one too. Previously executed test cases are re-executed in order to verify the impact of change. So UiPath helps in automating the set of same test cases to avoid the execution manually and saving time with accuracy.
Let’s start with the UiPath Test Suit:-
UiPath test suit is made up of four different components:
- Test Manager
- UiPath Studio Pro
Test Management Hub
The main purpose of this is to integrate the UiPath Test suit with third party tools (i.e. JIRA) using API Connectors to assign test cases to requirements, user stories and any other artifact, and create bug reports in an external bug tracking systems supplemented with log information and screenshots from test executions.
UiPath Test Manager is our web application that allows you to easily manage your testing processes. This application is hosted by the Test Management Hub. It covers the below functional areas:
- Assigning automation from StudioPro to test cases
- Assign test cases to requirements
- Dashboards to get a quick overview of your test results
- Manual testing and Creating defects from test results
Automate test cases by leveraging UiPath production-grade automation capabilities. StudioPro enables you to create automated tests just like you would create RPA workflows. RPA workflows can be converted into test cases or imported as test cases from other projects. After that the projects may published to the orchestrator, managed and executed from the test case page.
Orchestrator is the heart of your automation management. Once user publish the project from StudioPro to the orchestrator then UiPath Test Orchestrator manages the cases and has the ability to execute the test cases from StudioPro on testing robots (Scheduled manner) through the CI/CD (Continuous Integration and Continuous Delivery) pipeline.
This tab consists of four options:
- Tests Sets
- Test Cases
- Test Executions
- Test Schedules
- Test Data Queues
This represents the group of the individual test cases at a single unit that each serve as a particular purpose (e.g. Regression, etc.) across any number of projects. The Test sets page enables you to create new test sets as well as edit or execute the existing ones. The below is the Test Sets page in the orchestrator which currently have no set.
This page displays all the test cases from all the projects. These are the cases available in and comprising your test sets.
All the executed test sets with details are displayed on this page in the orchestrator.
This page enables you to execute the test cases in the planned manner and at predetermined intervals. The execution time is defined as per the specific time zones. You can also create the new test schedules of the sets and have the ability to view all the existing ones on this page in orchestrator.
Create a Test Schedule
- Click Add (+). The Add Test Schedulewindow is displayed
- Provide the Name, Description and select the test set.
- Select the time zone according to which the schedule is executed (not depended on the tenant time zone).
- Select the execution frequency of the schedule (Minutes, Hourly, Daily, Weekly, Monthly, Advanced).
- Click on the Add button at the bottom to save the Test Schedule.
You can also Edit/Update the existing schedules and also have the option to Enable/Disable the existing test schedules.
Tests Data Queues
This allows us to manage the test data. It acts as a container that holds your queue items ready to be consumed from the set of activities. The queue items are uploaded or removed from the test data queue according to a first-in-first-out (FIFO) principle.
Now let’s move to the Studio and learn about the activities that are used for the test automations.
UiPath RPA testing is designed for testing the workflows directly and viewing the activity coverage during the execution. This helps to ensure that the coverage is full of all the cases as per the requirements. To achieve this, the first step is to install the testing package in the studio. The testing activity pack includes all the activities that are required to easily verify the system that you are testing.
Go to Manage Packages -> All Packages and then search Testing -> Install “Uipath.Testing.Activities” Package (Refer the below Screenshots)
Once the activity is installed you can see the testing activities that are enabled and will be used while creating the workflows as shown below.
Application testing can be performed with Test Cases and Data Driven Test Cases,
Data Driven Test Cases use data imported as arguments into the project to verify test case execution. The entire data or only certain values may be used at execution.
Activities that are included in the package are shown below:
Verification activities such as Verify Control Attribute, Verify Expression, and Verify Expression with Operator are used for testing the data used by your workflows.
Verify Control Attribute: Verifies the output of the given activity by asserting it in relation to a given expression.
1. ContinueOnFailure – Specifies if the automation should continue even when the activity throws an error.
2. Expression – The expression against which you want to verify the output of the activity.
3. Operator – A drop-down list containing all of the possible mathematical operators you can use to verify the output of the activity. The following options are available:
4. TakeScreenshotIfFailed If set to True, takes a screenshot of the target process
Verify Expression: Verifies the truth value of a given expression. Input is same as the above activity. If this activity is included in Try Catch and the value of the ContinueOnFailure property is True, no error is caught when the project is executed.
Verify Expression with Operator: Verifies an expression by asserting it in relation to a given expression with an operator. The expressions tested with this activity must be inserted in their respective property fields.
Input is same as the previous one and below two input fields are included:
1. FirstExpression – The first expression in the verification process.
2. SecondExpression – The second expression in the verification process.
Now let’s understand the Test automations with one simple example:
Test Case: Verify that the user is able to login successfully into the web application on entering the correct email and password.
This is simple test case to check the login functionality of the web application. For this first we have to do the web automation for login into the website.
Here are the steps for Web Automations for Login
Create the Arguments (“Email, Password” String as “In” and “Thanks” Boolean as Out) as shown above and associate the arguments in the workflow.
When running this file this will open the website and by entering the Email and Password the user is able to login. After the login the user has to check some element that exists of not for which I have used the Element exist activity so that when doing verifications we get Boolean value of the text exists or not.
This is the website for which the web automation is performed.
Now right click on the .Xaml file -> Click on the Create Test Case and give name (i.e. TC_Login001) -> New Sequence is created with default activities (Given, When and Then sequences).
Given Block: Assign the input values which will be pass in the Web automations process as given below.
When Block: Invoke the Web Automations workflow
Import the arguments with the assigned variable as shown below
Then Block: Drag the “Verify Expression” activity and as per the Boolean value that you need to verify put into the Verify field. Make sure the value that should be matched with the Expected results variable.
In the properties panel if you want to capture the screenshots then you have to make the “TakeScreenshotsSucceed” option to “True”. The result of the verify expression will be shown in the console and you can also observed by running the workflow in the debug mode.
Now Run the Workflow to get the results.
See the verification result that the text which is matched after login is set to “True” and the case passed successfully. If after login the bot didn’t get the “Element Exists” value then it will get fail. For example if the Verify expression value is set to False then after matching with the web Element exists then the case fails automatically as shown below.
Run the workflow again and observe that the Verification failed due to the web expression gives the “True” value after the execution and the set value in the verify block is “False” which is not matching.
This is the simple example to how to perform the execution of the test cases in the UiPath. You can also publish the same project in the Orchestrator and from the above steps create the test sets and schedule the executions from their just like the other activities (e.g. Queues).
That’s all! Happy Automation!
Automation is the technique of reducing human effort and improve the performance simultaneously. So UiPath Test Automations makes it easy for us to perform the testing of the projects which minimizes the manual human effort of performing the same type of test cases again and again, also saves lot of time, reduces cost and provide accuracy.
2 thoughts on “Working with UiPath Test Automation”
Really nice article. Thanks for sharing this useful information. As a Software Tester it would be helpful for me
Pingback: RPA Developers | Ultimate Starter Guide 2020 - RPABOTS.WORLD