Working with UiPath Test Automation

Servesh Tiwari
13 Min Read
Robotics Process Automation in Finance and Accounting

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
  • Orchestrator
  • Robots
Working with UiPath Test Automation 5

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.

Test Manager

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
  • Reporting
  • Manual testing and Creating defects from test results

StudioPro

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

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.ย ย ย 

Testing (Orchestrator)

This tab consists of four options:

  • Tests Sets
  • Test Cases
  • Test Executions
  • Test Schedules
  • Test Data Queues

ย 

Tests Sets

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.

UiPath Tests Sets

Tests Cases

This page displays all the test cases from all the projects. These are the cases available in and comprising your test sets.

Tests Cases

Tests Executions

All the executed test sets with details are displayed on this page in the orchestrator.

Working with UiPath Test Automation 6

Tests Schedules

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.

Working with UiPath Test Automation 7

Create a Test Schedule

Steps:

  • 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.

Working with UiPath Test Automation 8

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)

Working with UiPath Test Automation 9

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.

Working with UiPath Test Automation 10

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.

Working with UiPath Test Automation 11

Activities that are included in the package are shown below:

  1. Data
  2. Verifications
Working with UiPath Test Automation 12

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.
Input:

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:

a.ย ย ย ย ย  Equality

b.ย ย ย ย ย  Inequality

c.ย ย ย ย ย  GreaterThan

d.ย ย ย ย ย  GreaterThanOrEqual

e.ย ย ย ย ย  LessThan

f.ย ย ย ย ย ย  LessThanOrEqual

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.

Working with UiPath Test Automation 17

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.

Working with UiPath Test Automation 18

When Block: Invoke the Web Automations workflow

Working with UiPath Test Automation 19

Import the arguments with the assigned variable as shown below

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.

ย 

result of the verify expression

ย 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.

Run the Workflow to get the UiPath Test 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.

UiPath Test Case Execution

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.

UiPath Test Result

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!

Conclusion

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.

References –ย 

  1. https://docs.uipath.com/test-suite
  2. https://forum.uipath.com/
  3. https://docs.uipath.com/studio/docs/rpa-testing

Share This Article
Servesh Tiwari is a Software Engineer with around 6+ years of experience in top IT MNCโ€™s. His passion is to help IT professionals, by providing technical training in RPA UiPath, Quality Assurance, and Database. He is a very energetic, process-oriented engineer and helps as many interested techies to let their career in RPA and Quality Assurance.
2 Comments