developing a bot which performs unit testing

polugopi

New Member
Hi,
I have a task to develop a bot which performs unit testing.
Is it possible ?
if yes please explain with an example.
 

VJR

Well-Known Member
Hi polugopi,

Yes, it is possible and is not a new concept since tests are already done in an automated way. There are specialised softwares in the market that are specifically used to conduct automated tests when the developed application reaches the Testing team. You can get in touch with a Software Tester if you want to see in-depth details on how they create scripts or use any other approach and run the various tests in an automated fashion. On the other hand Unit Testing is normally performed by the developers themselves or by their team mates, before it is handed over for further Testing.

From a RPA perspective, to begin with, you need to understand what Unit Testing is, if not already aware. To take a look at the Wikipedia definition of it you can check here. You can see mentioned here that one can view a unit as the smallest testable part of an application.

Coming back quickly on your task of bot creation for this, lets assume there is a Hospital Management System (HMS) and you need to create a testing bot for this. It has a screen with patient details as Name, Age, Gender. For instance this screen is specifically for adult patients over 18 years and maternity cases for females. Here you can see two units to create either separate bots or even one that combines both. I will combine them both for the sake of explanation. You will create a bot that will spy the Age box and validate it by entering all ages below, equal and above 18. If the Age control is a textbox rather than a dropdown, then you also need to insert alphabets and validate it. Another validation check is to see what happens if the box is left blank before hitting Save.

The bot will record which values were accepted and which ones were rejected. Probably on hitting the Save button at the bottom, the HMS shows a prompt like "Patient added successfully" or "Patient age incorrect". Depending on how the HMS reacts your bot will read what happened after hitting Save and will maintain data of what was accepted and what was rejected. The bot could also create an Excel or a Text file of all the inputs and their results. The same bot can check if female gender was selected during the submission. In short, the bot won't correct anything. It will only record the observations or in short "Unit Test" it.

I mentioned about Age and Gender fields, but the bot also needs to ensure about the Name field. Of course the bot will also Login to the HMS system. So other things like credentials, successful login, invalid attempts, etc. should also be verified while performing the tests through the bot. So imagine the depth the bot should test. Once all tests are showing 100% success results you can even have the RPA tool to automatically email the Excel or Text file to your boss ;).

Not only for Unit Testing, RPA is emerging to be used for other kinds of testing too.
You will find several links over the web on this topic. Here are a couple of them-
https://www.linkedin.com/pulse/test-driven-development-blue-prism-peter-lacken
https://dojo.ministryoftesting.com/dojo/lessons/rpa-as-a-power-tool-for-testing
https://cloudqa.io/robotic-process-automation-rpa-test-automation-myths-and-facts/
 

VJR

Well-Known Member
Hi polugopi,

To understand this can you tell what are the bots you have been involved in creating so far?
What Processes and Objects did it have?

If you haven't any yet and hence asking for the same then I suggest you to complete the Blue Prism's Training Order System exercise because truly speaking creating a bot for testing that has Processes and Objects is no different than developing Processes and Objects for any other application.
 
Top