What is Robot Framework?

Vedashree Paranjape
4 min readApr 13, 2024

--

In this article I will try to explain Robot Framework in a way which is a little bit like how your friend would teach you about a topic 30 mins before exam in the most brief, easiest yet understandable way so that you learn the concept quickly!

Robot Framework is essentially a wrapper around python, however anyone having zero knowledge of python can also become a Robot Framework expert. Now reason for this is that Robot Framework is keyword driven and uses plain English keywords and has many builtin and external libraries which allows you to setup your automation in a fashion very close to any plug and play system. The biggest advantage of Robot Framework is that it is Open Source i.e. FREE!

Robot Framework is a python package which you can easily install using pip command (pip install robotframework).

Robot Framework can have a simple project structure which is totally customisable as per use case:

Simple Project Folder Structure

Tests folder:

Resources folder:

In this basic example we are launching a Chrome browser instance, opening google.com and clicking on Sign in button. Here the 2 keywords in Testsuite File: LAUNCH APPLICATION IN BROWSER and LOGIN WITH GOOGLE are user defined keywords and those user defined keywords’ functionality is defined in the Resources file where Open Browser and Click Element are SeleniumLibrary keywords to which we have passed few arguments such as url, browser name and the xpath of the Sign in button.

This is the most simple and basic example but for more efficient structure you can explore and create advanced structure where you can keep the xpaths/locators under the ***Variables*** section in the Login.robot file of Resources folder or create a separate Variables folder and have a Variables.py file to store all the xpaths to have a somewhat similar pattern as POM, the possibilities are endless depending on the use case.

The SeleniumLibrary is one of the many External libraries and it offers the Selenium functions as simple keywords off the shelf so you can easily automate Chrome, Firefox, Edge, Safari browsers. There are some other libraries available for different applications such as AppiumLibrary for Mobile/Tab/SmartTV/Desktop apps automation, DatabaseLibrary for interacting with databases, RequestsLibrary for HTTP API testing functionalities and many more which can be easily installed with the pip commands.

There are Builtin libraries that are bundled with the framework for standard functions and provide the actual automation and testing capabilities such as BuiltIn, Collections, String, DateTime, Process, OperatingSystem etc. In addition, we can create our own custom libraries for any other use cases.

The Best part of Robot Framework is the log and report that gets auto generated after execution, no extra plugin or anything is needed for reporting! The log shows all the data about keywords, in case of failure the log has screenshot embedded and shows at which step the test failed.

Robot Framework supports parallel execution using pabot command.

Robot Framework integrates with many other tools for test management, CI/CD such as Jira, Xray, Jenkins, Azure pipelines, etc.

To summarize:

Robot Framework is:

  • Keyword driven
  • FREE
  • Simple Syntax, English keywords
  • It has Builtin and External libraries
  • Can be used to automate Browsers, Mobile Apps, Desktop Apps, Smart TVs, APIs, DBs, Embedded systems, etc.
  • Great Reporting
  • Supports parallel execution
  • Integrates with virtually any tool

Robot Framework used with Selenium and Appium:

Robot Framework integration with Jira and Xray:

To write your first Robot Framework script refer this: https://medium.com/@vedashreep/how-to-transition-from-manual-to-automation-testing-707bcca59dea

To know why Robot Framework is better choice than Java for browser automation refer this: https://medium.com/@vedashreep/automation-testers-stop-using-java-and-switch-to-robot-6fcbb6fa5bdc

Happy Learning!

--

--