DESOSA 2022

Robot Framework - A Keyword Driven Automation Testing Framework


As we move towards a more digitally integrated world, software’s effect is becoming increasingly important. It now plays a crucial role in all aspects of everyday life, including industrial/commercial purposes. All that is required is for the software to run smoothly and without errors. The shocking tales from around the world demonstrate the irreversible damage that software failure may inflict. According to a survey published by Tricentis in 2017, worldwide enterprises have reported a loss of 1.7 trillion dollars in assets, affecting 3.7 million people throughout the world. 1  In modern software systems, a continuous process of verification and validation is inevitable to deliver an excellent product as we build new features while maintaining existing ones. This, unfortunately, leads to a huge burden on software testing teams to ensure indispensable attributes like availability, quality, maintainability, and security. 

This is where ‘Automation Testing’ takes the role of a Superhero and achieves a higher level of quality and increased reliability while saving time and resources in contrast to regressive manual testing. Robot Framework (RF) is one of the few popular open-source automation testing software, which is written in Python. 2 It is a multi-platform automation testing environment with a very active developer community supported by industry stalwarts like Nokia and Siemens. It can be integrated with virtually any other tool to create powerful and flexible automation solutions and that too without any licensing costs.

Vision and Idea

Robot Framework provides end to end testing through Robotic Process Automation (RPA) implementation. It provides the freedom to extend it in any way the user wishes and the possibility to run it anywhere and however often they like. It has an easy syntax, utilizing human-readable keywords. The capabilities can be extended by built-in open-source libraries implemented in Python, Java or other programming languages. RF has a rich ecosystem of libraries and tools that are developed independently by various stakeholders and hence, is “Open Source” in the true sense.

Furthermore, RF is administered by a foundation, which is a non-profit consortium that encourages RF’s growth and development. The role of this democratic foundation is to provide funds and be involved in development. 

Key Domain Concepts

Problem domain

An effective automation testing environment must provide the following capabilities for its users:3

  1. It should be capable of reducing the overall testing time by a significant amount.
  2. It should be user-friendly. For example, regardless of skill and experience, onboarding time for a new user should be optimal. It should also have the capability of generating informative reports.
  3. It should improve the productivity of users by ensuring maximum test coverage with minimum effort. 
  4. The environment should be reliable and consistent in its performance. 

Robot Framework’s domain solution 

  1. RF provides a modular architecture that supports creating tests even for applications with several diverse interfaces, thus reducing the testing time. The ability to create reusable higher-level keywords from the existing keywords also makes the overall code more reusable, thus reducing overall testing time. 4
  2. RF provides an easy-to-use tabular syntax for developing standard test cases, as well as HTML-formatted result reports and logs. As a result, even a non-technical person can follow a test case, which makes it a perfect tool for test case automation. Additionally, ensuring standards for any new library that is to be added. The library documentation must contain proper documentation that should explain the usage and attributes of it, thus reducing the effort needed in skill learning even for a new user.
  3. RF provides tagging to categorize and select test cases to be executed so that multiple test cases scripted in different files can be selected as needed and executed without manually triggering them. This increases portability & adaptability and thus reduces development efforts in integration.
  4. RF takes advantage of its open-source capabilities to make it more dependable and consistent in its performance. As there are a number of large stakeholders in the Robot framework foundation who use the software and also provide funding for its further development, the overall stability and reliability of the system are kept at high standards.

Use Cases and Capabilities

  • Robot framework provides an extensive solution to produce reports in which two HTML files, namely log and report files, are generated. It makes it easy to analyze the execution of the test and causes of failure that would otherwise be obfuscated. The log file contains a hierarchical execution report based on multiple test suites, whereas the report file contains a high-level summary of tests and test statistics.
  • The framework’s modular architecture means it allows the testing of applications with numerous diverse features.
  • Even someone who isn’t familiar with programming languages can create scripts for various testing scenarios. This is achievable because the framework uses a keyword-driven testing strategy and includes an easy-to-use tabular test data syntax. The distance between testers and developers is already narrowing thanks to test-driven development. As a result, this framework may be viewed as a step in that direction as well. It also enables the generation of reusable higher-level keywords on top of existing ones because it is keyword-driven.
  • It allows creating customized test libraries in Java and Python using simple library APIs.
  • Provides tagging capability which allows testers to exclude and include specific test cases. For instance, the following command:  
robot --include Sanity --exclude Smoke Tests/Testsuite.robot

This would only run those test cases with the “Sanity” tag and exclude those with “Smoke” from the Testsuite.robot file. 5

Robot Framework - From a Context View

Robot Framework is supported by Python (both Python 2 and 3), Jython (JVM) and IronPython (.NET) and PyPy.  The precondition before installing Robot framework is to have any of the supported interpreters installed.

The recommended method for installing RF is using pip (Python package management system) as the latest Python, Jython, IronPython and PyPy versions contain pip bundled in

It can be installed using pip by the following command: pip install robotframework

Python 2 hasn’t been officially supported since 2020. However, RF continues to support it in its most recent stable release, RF 4.x, mostly to support Jython and IronPython, which don’t have Python 3 compatible releases. However, from RF 5.0 forward, Python 2 support will be eliminated.

Study of Stakeholders

Foundation members:

The foundation consists of a group of individuals, organizations and companies which support the development of the tool through funding. New members join by vote in by previous members. This support is purely financial and they are not involved with suggesting development road maps. The development roadmap is purely community-driven. Hence, when a foundation member donates to the foundation, they trust that their money will be put to good use. Some of these members include ING, NOKIA etc. 6

Board:

It consists of 7 individuals elected by the foundation members, which include the Chairman of the Board, Vice-Chair, Secretary and Treasurer. They are the top-level executives looking after overall management within the RF ecosystem, and are responsible for monitoring and finalizing community roadmap interests. 

Workgroups:

They are an extended managing unit of Robot Framework with limited or domain-specific executive power. With the current operation, all practicalities cannot be handled only by board members. At the board meeting, workgroups are formed to handle different topics and involve additional personnel who have displayed their interests and capabilities. An example includes the managing team of “Robocon” - an annual dev event of RF Foundation.

Individual Developers/Contributors:

The core of RF lies in the democratic structure of its community-driven roadmap. Individual developers/Contributors make up the bulk of the community. They are involved in adding enhancement, fixing bugs and recommending improvements to the tool. A large fraction of the community is also simply individual users of the platform.

Suppliers:

This category of stakeholders includes service/platforms/dependabilities (Almost all are open source) over which RF and its extensions have been developed. An example is the selenium extension, which allows the use of RF for web applications, which depend on the selenium framework. Hence, all extensions of RF depend upon the compatibility provided by these original platforms/services.

Enterprise Users: 

These include organizations with multiple developers that are using RF. However, there is no preferential treatment of enterprise developers compared to individual developers, and everyone is at the same level.

Key Quality Attributes

RF, as a quality assurance aiding software itself, is architected with various qualities in mind to produce a product that meets not only functional but also non-functional demands such as reliability, dependability, security, and maintainability. 

The main aim of RF was to enable maximum usability with an easy-to-use testing framework so that anyone with less technical knowledge would be able to create a test suite. With an active forum, GitHub, and slack community support, RF is approachable and provides proper serviceability. Many lead developers are religious in responding to questions and suggestions from the users of the community at various levels.

Every open-source software faces an open-ended question about data security and vulnerabilities from high-level stakeholders who are contemplating using it. RF is no exception. But the transparency in terms of their code maintenance would confront such issues, since anybody in doubt may check for all types of security vulnerabilities in the code themselves. There are also well-documented guidelines for contributing to the code.7 This sustains code integrity and also the compliance/ethics of the code.

Robot Framework is keyword-driven. It substantially enhances the reusability and maintainability of test codes. Modularization and abstraction improve the readability of both test code and test case.

Roadmap

Whenever a new release is planned, new features and enhancements are prioritized based on the community survey. There are two major milestones, v5.0 and v5.1, planned to be rolled out on 28th Feb and 13th June, respectively. Following is the brief outline for the same:

  1. The v5.0 release plans to include native support for keywords like inline IF, TRY/ EXCEPT, WHILE, RETURN, BREAK/CONTINUE. While library keywords can use any structure as needed internally, adding native support for these keywords will facilitate easier customization of user keywords. Currently, support exists for all the above-mentioned keywords, but the solutions are less intuitive. The ultimate goal is to make each solution more natural for the non-programmers to increase familiarity.8 
  2. The plan also includes removing Python 2, 3.5  support. The main benefit of moving to newer versions is being able to use notable Python 3.6 features like f-strings in v5.0. 
  3. The main objective for the future release, v5.1, is to add support for prefixes like GIVEN/ WHEN/ THEN in languages other than English. The same multi-language support is also planned for markers in data like section headers, settings etc. 9 

Ethical Considerations

A few instances where ethical considerations of the RF community’s workflow gets highlighted are listed below. 

  1. The framework is open-source and free to use and contribute to, with no licensing requirements. If someone wishes to be a part of the robot framework foundation, there is a fee  6 . This money goes towards the framework’s development. The contribution has a maximum cap, ensuring that the organization’s democratic essence is preserved and that every member has a vote in its foundation and decision-making.
  2. Robot Framework maintained to support Python 2 despite the fact that official Python 2 support stopped in 2020, as Jython and IronPython did not support Python 3. This demonstrates that RF considers the principles of multiplatform support as well as the convenience of the entire user base.
  3. When a new release is planned, input and surveys from the active monitoring of github issues, conversations in the active Slack community, and user surveys are used to prioritize new features and enhancements.

References:


  1. Aayushi Sahu, What Makes Software Testing and QA Important for Business? https://www.westagilelabs.com/blog/why-is-software-testing-and-qa-important-for-any-business/ ↩︎

  2. Stresnjak, Stanislav, and Zeljko Hocenski. “Usage of robot framework in automation of functional test regression.” Proc. 6th Int. Conf. Softw. Eng. Adv.(ICSEA). 2011. ↩︎

  3. Mathew Setter, 5 Reasons Automated Testing Is Worth the Investment https://www.cloudbees.com/blog/5-reasons-for-automated-testing ↩︎

  4. Bisht, Sumit. Robot framework test automation. Packt Publishing Ltd, 2013. ↩︎

  5. Executing Test Cases Documentation - Github- https://github.com/robotframework/robotframework/tree/master/doc/userguide/src/ExecutingTestCases ↩︎

  6. Robot Framework Foundation, https://robotframework.org/foundation/ ↩︎

  7. Contribution Guidelines - Github, https://github.com/robotframework/robotframework/blob/master/CONTRIBUTING.rst ↩︎

  8. v5.0 Milestone - Github - https://github.com/robotframework/robotframework/milestone/52  ↩︎

  9. v5.1 Milestone - Github https://github.com/robotframework/robotframework/milestone/61  ↩︎

Robotframework
Authors
Arunjunai Rajan Senthil Kumar
Nilay Aishwarya
Suchdeep Singh Juneja
Sreeparna Deb