Robot Framework

LEELA S
2 min readApr 7, 2022

Robot Framework is an open source test automation framework for acceptance testing and acceptance test-driven development.

It follows different test case styles:

  • keyword-driven
  • behaviour-driven
  • data-driven for writing test cases

This feature makes it very easy to understand.

Robot Framework Project Basic structure

  • Libraries Folder : contains custom keyword libraries
  • Resources Folder : contains the reusable Robot code files
  • Results Folder : contains the executed test results
  • Tests Folder : contains the Robot tests

Example

Test Scripts

Robot Framework test scripts are text files with the *.robot or *.txt extensions. The four sections of basic Robot test scripts are

  • Settings
  • Variables
  • Test Cases
  • Keywords

Basic Structure of Robot Framework

1)Settings

The settings section contains the import statements for the external libraries, resources, and the setup and teardown commands.

2)Variables

The variables section contains keyword arguments, global, and local values. Variables make it easy to change the test data in one location.

3)Test Cases

The test cases section contains the test cases. Two of the more common approaches to writing test cases are keyword-driven and Gherkin.

4)Keywords

The keywords section contains operations used to execute the tests. The different types of keywords are built-in keywords, library keywords, and user-defined keywords. Built-in and library keywords are lower-level keywords defined by the built-in Robot Framework library or an external library such as Selenium. User-defined keywords are keywords created by combining library keywords.

Example

Output

--

--