Skip to content
Tutorials Center
My learning

Topics

Lesson 1 of 36 ยท Getting Started

What Is Robot Framework?

Meet Robot Framework, the open-source keyword-driven tool for acceptance testing and automation. See what it is for, how it works and what you will build.

Robot Framework is an open-source automation framework. You describe what a test should do in plain, table-like text files, and Robot runs those files and writes a detailed report. It is used for acceptance tests, API and web tests, end-to-end checks, and also for "robotic process automation" (RPA), where the same files automate routine work instead of testing it.

Its main idea is keyword-driven testing. A test is a list of readable steps called keywords, such as Open Browser, Input Text or Should Be Equal. Each keyword is backed by real code (Python, usually) or by other keywords you write yourself. That makes tests readable to people who do not program, while programmers keep full power underneath.

Honesty note. Robot Framework cannot run on this site, so every .robot file in this course is shown as read-only text, and its output is shown only when it is certain. The runnable blocks are Python stand-ins that reproduce the underlying ideas (parsing the files, calling keywords, reporting results). Each stand-in is labelled. To run the real thing, install it on your own computer in the next lesson.

What a Robot test looks like

Here is a complete test suite. It is a plain text file with the extension .robot:

ROBOTFRAMEWORK
*** Settings ***
Documentation     Checks that basic arithmetic helpers behave.

*** Test Cases ***
Addition works
    ${total}=    Evaluate    2 + 3
    Should Be Equal As Integers    ${total}    5

Greeting is friendly
    ${text}=    Catenate    Hello,    Robot!
    Should Be Equal    ${text}    Hello, Robot!
    Log    The greeting was ${text}

You see two test cases. Each has a name on the left edge and indented steps below it. A step is a keyword followed by its arguments, separated by two or more spaces. ${total} is a variable that receives the result of a keyword. If a keyword raises an error, the test fails; if every step finishes, it passes. You never write assert or def test_....

The parts of the framework

Robot is a small core with a large ecosystem around it.

flowchart LR
    A["Test data<br/>.robot / .resource files"] --> B["Robot Framework core"]
    C["Libraries<br/>BuiltIn, Collections, SeleniumLibrary..."] --> B
    B --> D["output.xml"]
    D --> E["log.html"]
    D --> F["report.html"]

Test data goes in, libraries provide the keywords, and the core writes machine-readable output plus two HTML files.

  • Test data is what you write: suites, test cases, user keywords and variables.
  • Libraries are collections of keywords implemented in Python (or Java, or remote servers). The BuiltIn library is always available; others such as Collections ship with Robot; thousands more are installed separately, like SeleniumLibrary and Browser for web testing and RequestsLibrary for HTTP.
  • The core reads the data, runs keywords, measures time and records everything.
  • Output files are output.xml (the full result), log.html (every step with details) and report.html (a short summary).

Where Robot shines

Good fit Why
Acceptance and end-to-end tests Readable steps that business people can review
Web, API, mobile and desktop testing Many ready-made libraries
Data-driven tests A template runs the same steps with many inputs
Mixed teams of testers and developers Testers compose keywords, developers write them
Reports for stakeholders Built-in HTML logs and reports
RPA The same syntax (as *** Tasks ***) automates work

It is a weaker fit for tiny unit tests of pure functions. Tools such as pytest are lighter there. Many teams use both: pytest for units, Robot for acceptance.

A stand-in: keywords calling code

The block below is not Robot Framework. It is about 30 lines of Python that mimic the core idea: a text table of steps, a dictionary of keywords implemented as functions, and a runner that reports PASS or FAIL. Reading it makes the rest of the course easier, because the real framework does the same thing at much larger scale.

Python Stand-in: a 30-line keyword runner

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The runner looks up each keyword name (lowercased) in a dictionary, so Should Be Equal As Integers finds the function should_be_equal_as_integers. Real Robot also ignores case, spaces and underscores in keyword names.

Robot at a glance

What Robot Framework is

Plain-text tests Readable tables of steps
Keywords Each step calls a keyword
Python underneath Libraries are real code
1 / 2

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the main idea behind Robot Framework?

    Robot is keyword-driven: a test is a sequence of keyword calls, and keywords are implemented by libraries or by user keywords.
  2. 2. How does a Robot test fail?

    A failing keyword (an exception such as a failed assertion) fails the test. If every step finishes, the test passes.
  3. 3. Which file gives the short summary of a run?

    report.html is the summary; log.html has every step; output.xml is the raw result both are built from.
  4. 4. Why can this site not run real .robot files?

    The site runs Python through Pyodide but has no Robot Framework install, so the course shows read-only Robot code and runnable Python stand-ins.

Summary

  • Robot Framework is an open-source, keyword-driven tool for acceptance testing and automation (RPA).
  • Tests are plain-text .robot files; steps are keywords with arguments separated by two or more spaces.
  • Libraries supply keywords; the core runs them and writes output.xml, log.html and report.html.
  • It suits readable acceptance, web, API and data-driven tests; pytest is lighter for pure unit tests.
  • On this site Robot code is read-only; Python stand-ins are labelled.

Next: Installing Robot Framework and Running Your First Test