DEV Community

Raghwendra Sonu
Raghwendra Sonu

Posted on

Robot Class vs Robot Framework vs Robotic Process Automation

In this article i am going to talk about the buzz words around Robot. So, now a days in Software Test Automation we are coming across Robot Class, Robot Framework and Robotic Process Automation frequently. They are all different. Let me explain how.

Robot Class

This is coming from Java AWT package. It is used to trigger the input events like mouse move, mouse click, keypress, etc during test automation.
An Example:
public class robotic
{
public static void main(String[] a)
{
String command = "wordpad.exe";
Runtime run = Runtime.getRuntime();
run.exec(command);
//instance of Robot class
Robot myrobot = new Robot();
// keypress will make the virtual keyboard press
myrobot.keyPress(KeyEvent.VK_S);
Thread.sleep(100);
robot.keyRelease(KeyEvent.VK_S);
myrobot.keyPress(KeyEvent.VK_O);
Thread.sleep(100);
robot.keyRelease(KeyEvent.VK_O);
myrobot.keyPress(KeyEvent.VK_N);
Thread.sleep(100);
robot.keyRelease(KeyEvent.VK_N);
myrobot.keyPress(KeyEvent.VK_U);
Thread.sleep(100);
robot.keyRelease(KeyEvent.VK_U);
}
}

Wordpad will be opened and Output will be- SONU

There are some of the drawbacks of this class. So not extensively used in test automation. If you use Robot class, you need to make sure that no other window is open during test execution, because Robot class will work on active window.
This makes parallel running not possible if using this class in code.

Also, if you use keyPress event of this class then you should use keyRelease event if not then it will remain pressed and consume memory in the background.

Robot Framework

Robot Framework is an open source automation framework for acceptance testing and robotic process automation (RPA). The core framework is implemented using Python and runs also on Jython (JVM) and IronPython (.NET). This is very easy to learn and implement. But, not that popular in market. So,only few people know this framework.

Robotic Process Automation

Robotic means any entity which is capable of mimicking human action. Process means sequence of steps and Automation means without human intervention. This is new type of automation tools which needs no/ less programming skills. Mostly used for process automation. Most of the things are drag and drop in RPA tools. Market trends shows down the line this will get more popularity. There are many popular RPA tools like UI Path, Automation Anywhere and Blue Prism.

I hope i was able to give you some useful information. You can connect to me at LinkedIn- https://www.linkedin.com/in/raghwendra-sonu

Top comments (0)