What is Robot Framework? Keyword-Driven Test Automation
Robot Framework is an open-source, keyword-driven framework for acceptance testing, ATDD and RPA. How it works, libraries, common mistakes and FAQ.
What is Robot Framework?
Robot Framework is an open-source, Python-based automation framework for acceptance testing, acceptance test-driven development (ATDD) and robotic process automation (RPA). Tests are plain-text files built from keywords, so people who do not write code can read them, while developers add new keywords in Python, Java or other languages.
How Robot Framework works
Test data lives in plain-text files, usually with the .robot extension, split into sections marked by headers such as *** Settings ***, *** Variables ***, *** Test Cases *** and *** Keywords ***. Fields are separated by two or more spaces. Each line calls a keyword with arguments, and keywords can be combined into higher-level keywords that describe business actions.
Keywords come from libraries. Robot Framework ships with standard libraries and has a large ecosystem of external ones. Browser Library is based on Playwright, and others cover Selenium, APIs and databases. Running tests produces report, log and XML output files that CI servers can read. Version 7.4.2 is shown as current on robotframework.org, and the framework is supported by the non-profit Robot Framework Foundation.
Example: a login test
A test named Valid Login calls keywords such as Open Login Page, Input Username, Input Password, Submit Credentials and Welcome Page Should Be Open. The low-level steps live in the *** Keywords *** section or in a library, so the test itself reads like a requirement. When the login screen changes, you fix one keyword, not every test. This suits regression testing that product and QA people review together.
Common mistakes with Robot Framework
- Writing long tests of low-level steps instead of building keywords that describe intent.
- Putting logic in the test data. Loops and conditions in
.robotfiles get hard to read, so move them into a Python keyword. - Copying locators and test data into many tests instead of using variables and resource files.
- Mixing too many external libraries without pinning their versions.
- Treating a green report as proof of performance. Functional tests do not show behavior under load.
Robot Framework and other testing tools
Robot Framework often sits on top of other tools. For web tests it can use Playwright through Browser Library, see what Playwright is. For APIs it can call endpoints, which overlaps with API testing. If you like the readable acceptance style in Ruby, compare Capybara. Java teams may also look at TestNG.
Robot Framework checks that features work. To see how a backend behaves with many users at once, run a load test. LoadFocus can run existing JMeter scripts in the cloud, see JMeter load testing. LoadFocus does not integrate with Robot Framework.
FAQ
Is Robot Framework free?
Yes. It is open source under the Apache License 2.0, with no licensing fees.
Do I need to know Python to use Robot Framework?
Not to write tests from existing keywords. To create new keywords or libraries you usually write Python, although Java and other languages are possible too.
What is keyword-driven testing?
Tests are written as a sequence of named actions (keywords) instead of code. Keywords can be built from other keywords, which keeps tests readable and reusable.
Can Robot Framework test web apps and APIs?
Yes, through libraries. Browser Library, based on Playwright, and a Selenium library cover web UIs, and further libraries cover APIs and databases.
Can Robot Framework do load testing?
Not by itself. It runs functional and acceptance tests. Use a load testing tool to measure behavior under many concurrent users.
Related terms
Related LoadFocus Tools
Put this concept into practice with LoadFocus, the same platform that powers everything you just read about.