The future is already here. Robotic innovations can easily handle difficult tasks and make our lives more comfortable. Even in software development and testing, robots can automate many activities.
In this article, we overview robotic process automation (RPA) technology and a popular RPA tool — UIPath. We look at this tool from an unusual angle, exploring ways you can use UIPath to prepare performance testing data.
This article will be useful for software testers, quality assurance specialists, and anyone interested in unusual applications of RPA technology.
What is RPA? Robotic process automation technology is based on the use of software robots, or bots. These robots can be configured to manipulate applications and systems and thus execute tasks. RPA is the scripting of repetitive user actions based on the graphical user interface (GUI) image recognition. By interacting with user interfaces, RPA robots mimic human actions with digital systems, transfer and interpret data, and trigger responses to events.
RPA robots can be used for automating the majority of routine tasks and processes:
Automation makes repetitive processes less time-consuming, decreases the risk of human error, and allows employees to focus on more important tasks.
Software testing is one of the areas that can benefit greatly from the use of RPA. In particular, different RPA solutions can be used for automating processes such as preparing test data for performance testing.
Currently, there are two popular RPA solutions on the market:
We’ll overview the capabilities of Automation Anywhere in future articles. For now, let’s focus on UIPath and its use in software testing. Below, we highlight the general capabilities of this tool and share our experience using UIPath for performance testing data preparation.
So what is UIPath? UIPfath is a popular robotic automation process platform that provides various capabilities for automating business processes. The platform is composed of three main components:
- Studio — a desktop application for writing scripts
- Robot — an agent that executes scripts on a user’s computer
- Orchestrator — a web interface for managing scripts and robots
There are also additional tools, including ones for working with machine learning models and chatbots.
UIPath can automate both web and desktop applications and can be integrated with most Microsoft Office applications, including Excel and Outlook. Currently, the platform supports only Windows and offers four subscription options:
- Community Cloud
- Enterprise Cloud
- Enterprise Server
In this article, we’ll use Community Cloud, the free edition of UIPath. Community Cloud provides you with basic UIPath features and three robots. That’s enough for evaluating the overall capabilities of the platform and for accomplishing our task within this article — generating test data for performance testing.
Let’s see what you can do with this RPA platform when testing your software products.
6 Ways to Improve Software Testing
Preparing test data for performance testing is a perfect task for RPA solutions, as they’re great at collecting and merging data from various sources and in various formats.
Let’s see how we can prepare data for software performance testing with an RPA tool. Say we have a feature that supports four web browsers and works with different browser data: browser history, downloads, bookmarks, cache, and cookies. To make sure this feature performs smoothly, with no interruptions, errors, or data leaks, we should test it with massive amounts of browser data.
Note: The volume of test data should significantly exceed regular volumes of data that the solution under test is supposed to process on a daily basis. Only then can you ensure proper efficiency of performance testing.
For a web browser feature, we’re talking about the amount of data that a regular user would create in a couple of years of working with a browser. Based on our previous projects, we would say it’s enough to generate about 300,000 browser history records, 1,000 bookmarks, and around 100,000 download records.
Creating massive browser artifacts manually would take too much time. And here’s where UIPath comes in handy: using this tool, we can automate the generation of test data.
Most of the work is done in Studio, where we create scripts. The overall process of generating test data includes three key steps:
- Generating scripts
- Testing and debugging scripts
- Turning scripts into robot-executable packages
Let’s look closer at each step.
In UIPath, designing new scripts is rather simple, as it resembles the process of building a diagram in a flowchart maker. Studio offers a rich selection of predefined script blocks. All you need to do is select the blocks you need sequentially (Figure 1).
Once selected, script blocks can be configured and tuned with the help of special functions (Figure 2).
UIPath currently offers 337 functions for tuning standard scripts.
As we’re working with a browser feature, the first block we need to add to our script is for launching the web browser. In UIPath, this is done with the Open Browser function that launches a specified browser and opens its home page.
Open Browser has a wide selection of options: among other things, you can select the target browser (BrowserType), choose to start a new session (NewSession), or choose to open an incognito session (Private).
Note: In order for the Open Browser function to execute successfully, you need to install a corresponding UIPath extension on your target browser. This extension will also be used as an interface for further communication between the UIPath robot and the browser.
As our goal is to generate various browser artifacts, we can create a script based on a simple algorithm of actions:
- Start the browser
- Open a URL
- Add the URL to bookmarks
- Download a file
- Close the browser
For each of these actions, there’s a special function in UIPath. For example, one way to create a bookmark in any browser is by using the CTRL+D hotkey. By using the Send Hotkey function, we can emulate bookmark creation by a user.
A new script is composed pretty much like a puzzle: you select a block for a particular action (say, launching a browser), add it to your script, and check if it works. Script testing is performed manually for each newly added block.
Once all the script blocks are composed into a single sequence, run the entire script once more to test its performance. If one of the steps isn’t performed properly, go back to the responsible script block and check its configuration.
Once you’ve checked and debugged your script, you need to loop the sequence of user actions for the required number of repetitions. In UIPath, there’s a For Each operator that allows you to perform single actions as well as a series of activities for each element of a script.
As we don’t need to open and close a browser window each time we create a new bookmark and download a file, for instance, we can use the For Each operator to loop only the steps performed within the opened browser window:
- Open a URL
- Add it to bookmarks
- Download a file
Since our example feature is supposed to work with four web browsers, we need to create four different packages — one package per browser. Then we assign these packages to UIPath robots — one package per robot. Since the subscription model we’re using provides us with only three robots, we’ll need to assign two packages to one of them.
After that, our mission is complete and we can automatically generate the browser artifacts corresponding to a couple of years of web browser exploitation by a human user.
To summarize our experience preparing data for software performance testing using UIPath, let’s look at the key pros and cons of UIPath:
Table 1: Pros and cons of using UIPath for software testing
Paid license is required to use more than three robots or implement advanced features
Provides a free subscription model with a sufficient feature set
No support for object-oriented programming (OOP), leading to linear code with multiple duplications
Little to no learning curve
No error logs or thorough system logging in Orchestrator
Provides a handy tool for writing scripts with a rich selection of customization options
Scripts are easy to adapt to a product’s new user interface
UIPath is a useful robotic process automation tool that can be used not only for automating business processes but also for preparing quality test data for software testing. This platform is easy to work with and highly configurable. Plus, the capabilities of its free version are sufficient for preparing test data for small projects. Overall, executing automated preparation of testing data with RPA tools can help software testing specialists spend less time on routine tasks.
At Apriorit, we have a team of quality-obsessed software testers who can ensure your solution performs just the way you want it to. Get in touch with us to start discussing your project.