Robot Framework Foundations, ATDD, BDD, RPA, and Use Cases: Core Concepts and Mental Model
Build a precise mental model of Robot Framework as a generic keyword-driven automation engine, separating tests/tasks, keyword layers, external systems, and result evidence.
Learning objectives
- Explain Robot Framework's definition, execution, adaptation, and result layers.
- Distinguish tests, tasks, user keywords, library keywords, variables, and result artifacts.
- Separate Robot Framework core from browser/API/database/SSH/RPA libraries and CI/editor tooling.
- Explain keyword-driven, BDD-style, and data-driven specification at a beginner level.
- Run and interpret a safe BuiltIn-only example without touching external systems.
Current compatibility baseline. Checked 2026-08-30: Robot Framework 7.4.2 is the current stable release and requires Python 3.8 or newer. Robot Framework 7.5b1 exists as a pre-release; this chapter does not rely on pre-release-only behavior. BuiltIn is automatically available and needs no explicit import.
1. Why Robot Framework exists
Automation projects often fail before they fail technically. A business requirement is written in one vocabulary, implementation code uses another, CI reports a third, and operational scripts live somewhere else. The result is a gap between intent and evidence: people can see that something ran, but they cannot confidently say what requirement was exercised, what external state changed, or why a run passed or failed.
Robot Framework addresses that gap with a generic execution engine built around named keywords. A suite contains tests or tasks. Those tests or tasks call keywords. A keyword may be defined in Robot Framework data as a reusable user keyword, or supplied by a keyword library as a library keyword. The framework parses the source, resolves calls, executes them, records status and messages, and produces structured result artifacts.
The key word is generic. Robot Framework itself does not become a browser driver, HTTP client, database engine, SSH client, or cloud SDK. Domain-specific work comes from standard libraries, external libraries, or custom libraries. Keeping that boundary explicit is the first habit of reliable Robot automation.
2. The execution mental model
flowchart TD I[Automation intent] --> D[.robot / .resource data] D --> P[Parser and execution model] P --> S[Suite] S --> T[Test or task] T --> K[Keyword resolution] K --> U[User keyword] K --> L[Library keyword] U --> L L --> X[System or value under automation] X --> R[Status and messages] R --> O[output.xml] O --> H[log.html / report.html]
Read the diagram left to right. The source file expresses intent in structured text. Robot Framework parses the file into an executable model. During execution, each test or task resolves keyword names and arguments. User keywords can compose lower-level keywords; library keywords are the adaptation point to Python or another external technology. Results flow back into Robot's status model and then into machine-readable and human-readable artifacts.
This model prevents a common category error: a failed browser click
is not "Robot state." The Robot test has a status; the
Selenium/Browser library owns a browser session; the application
owns its own server-side state; CI owns a workspace; and
output.xml records what Robot observed. Those are
related but separate stores.
3. Core objects and who owns them
| Object | Meaning | Typical owner/state | First evidence to inspect |
|---|---|---|---|
| Suite | A file or directory-level grouping of tests/tasks. | Robot execution model. | Suite name/source in console, log, or output. |
| Test case | An executable verification whose pass/fail status represents an expected outcome. | Robot result model plus any external state it exercises. | Test name, status, keyword trace. |
| Task | An executable automation job using task terminology; syntax is largely the same as tests. | Robot result model plus operational state changed by its libraries. | Task name, status, external side effect evidence. |
| User keyword | A reusable higher-level action written in Robot data syntax. | Suite/resource source and local arguments/variables. | Resolved keyword name and nested trace. |
| Library keyword | A keyword implemented by a library, commonly Python. | Library instance plus any external object/session it controls. | Library documentation, keyword trace, external evidence. |
| Variable | A named value with a defined scope and provenance. | Robot scope, Python object, environment, variable/resource file, or CLI input. | Where it was defined and what scope can see it. |
| Result artifact | Structured or rendered evidence from a run. | Execution output directory. |
output.xml, log.html,
report.html.
|
4. Tests and tasks: same engine, different intent
Robot Framework supports both test automation and robotic process automation (RPA). The execution machinery is closely related, but the semantics you attach to the work should differ. A test asks whether an observed outcome satisfies an expectation. A task asks Robot to perform an automation job and report whether that job completed according to its defined failure semantics.
Test example
"Release candidate status should be ready." The
central product is evidence about correctness. An assertion
failure is useful signal.
Task example
"Prepare a synthetic handoff summary." The central product is an operation. Assertions may still protect preconditions, but a task is not automatically a test merely because it can fail.
Do not blur the two by writing a task that changes production state and then treating its PASS status as proof that the business outcome is correct. Conversely, do not use Robot for every low-level unit test merely because its syntax can call Python code. The framework is especially valuable when readability, orchestration across keyword layers, system/integration testing, acceptance criteria, or RPA workflows matter.
5. Keyword-driven, behavior-driven, and data-driven specifications
Keyword-driven specifications describe a sequence of named actions. They are often imperative: get a value, perform an action, verify a result. Behavior-driven wording emphasizes externally visible behavior using natural-language-style steps such as Given, When, Then, And, and But. Robot Framework does not run a separate BDD engine for these prefixes; it applies keyword matching rules that can ignore the prefix when resolving a matching keyword. Data-driven specification separates a reusable flow from rows or sets of input data. Later chapters develop templates and embedded arguments in depth.
*** Variables ***
${STATUS} ready
${EXPECTED} ready
*** Test Cases ***
Keyword-Driven Readiness Check
Log Checking a synthetic release candidate
Should Be Equal ${STATUS} ${EXPECTED}
BDD-Style Readiness Check
Given candidate status is ready
When readiness is evaluated
Then candidate may proceed
*** Keywords ***
Candidate status is ready
Should Be Equal ${STATUS} ready
Readiness is evaluated
Log Evaluating synthetic readiness
Candidate may proceed
Should Be Equal ${STATUS} ready
The second test does not require Cucumber, Gherkin parsing, or a step-definition runtime. Robot still resolves keyword names in its own model. The natural language is a specification style layered on the same keyword execution machinery.
6. Core framework versus libraries and tools
| Capability | Belongs to Robot Framework core? | Typical provider | State boundary to remember |
|---|---|---|---|
| Parsing suites, executing keywords, producing results | Yes | Robot Framework core | Execution model and result tree |
| Generic assertions and logging | Yes | BuiltIn standard library | Robot keyword/status/messages |
| Browser automation | No | SeleniumLibrary or Browser library | Browser process/session/context |
| HTTP/API calls | No | External HTTP library or custom library | HTTP client/session and remote service |
| Database queries | No | Database library/custom library | Connection/transaction/database state |
| Parallel execution | Not the Pabot process model | Pabot external project | Worker processes and shared resources |
| Editor language support | No | RobotCode or other editor tooling | Editor interpreter/profile settings |
| CI orchestration | No | GitHub Actions, GitLab CI, Jenkins, etc. | Runner/job/workspace/artifacts/secrets |
A production design review should be able to point to each row and say who owns lifecycle, credentials, cleanup, and evidence. That is far more useful than saying "Robot does the automation."
7. Inspect before you mutate
Before debugging or changing an automation environment, establish what is actually running. For this first chapter the most useful read-only checks are the Python interpreter identity and the Robot Framework version. Chapter 02 teaches environment construction in depth; here the goal is provenance.
# Bash / POSIX shell
python --version
python -m robot --version
python -m pip show robotframework
# PowerShell
python --version
python -m robot --version
python -m pip show robotframework
Record the output rather than assuming a globally installed
robot launcher belongs to the same Python shown by
python --version. Using python -m robot is
an explicit way to couple execution to the selected interpreter.
8. A smallest safe BuiltIn-only run
The following suite reads only synthetic values. It does not access
the network, filesystem beyond result generation, a browser, a
database, or any real account. BuiltIn is automatically available,
so no Library import is needed.
*** Settings ***
Documentation Chapter 01 read-only mental-model example.
*** Variables ***
${CANDIDATE} build-142
${STATUS} ready
${EXPECTED} ready
*** Test Cases ***
Release Candidate Is Ready
Log Candidate=${CANDIDATE}
Should Be Equal ${STATUS} ${EXPECTED}
Run it with an explicit output directory:
python -m robot --outputdir results readiness.robot
Expected observations are more important than memorizing the
command. Robot parses one suite, creates one test result, resolves
Log and Should Be Equal from BuiltIn,
marks the test PASS when the values match, and writes result
artifacts under results/. By default, the familiar
files are output.xml, log.html, and
report.html.
Evidence rule: a green console line is convenient, but it is not the complete evidence model. The XML output is machine-readable execution data; the HTML log provides detailed keyword-level diagnosis; the report provides a higher-level execution summary.
9. Why this matters in DevOps
Release pipelines need evidence that can be interpreted later, not merely a command that returned zero once. Robot Framework is useful when it helps connect a named requirement or operational intent to a repeatable execution, a controlled environment, explicit failure semantics, and retained artifacts.
That means a CI job should eventually be able to answer: Which suite and test/task ran? Which versions were used? Which data or environment was selected? Which external systems were touched? Which keyword failed first? Where are the original results? Was a retry or rerun involved? Those questions are governance questions as much as testing questions.
10. Trust, privacy, and safety boundaries
Robot logs can capture keyword arguments, returned values, console messages, external responses, and nested failures. Treat result artifacts as potentially sensitive. The fact that a value appears inside a test variable does not make it safe to publish. Later chapters cover secrets explicitly; this chapter uses only harmless synthetic values.
- Do not use personal browser profiles, production accounts, real API tokens, SSH keys, database passwords, or employer/customer systems in a beginner lab.
- Do not disable TLS or SSH verification as an automation shortcut.
- Do not interpret a task PASS as authorization to perform the same task against production.
- Keep result artifacts long enough to diagnose first failure, then apply an intentional retention policy.
11. Hands-on lab — map source, execution, state, and evidence
Create a temporary directory named rf-ch01-lab. Place
the BuiltIn-only suite from Section 8 in
readiness.robot. Before running it, predict two facts:
(1) the synthetic values will not change, because no keyword mutates
them; (2) the output directory will gain result artifacts. Run the
suite once and verify those predictions.
-
Preflight: record
python --versionandpython -m robot --version. -
Run
python -m robot --outputdir results readiness.robot. - Confirm the console identifies one test and a PASS result.
-
Confirm
results/output.xml,results/log.html, andresults/report.htmlexist. -
Open
log.htmllocally and expand the test. Locate the two BuiltIn keyword calls. - Write one sentence for each layer: source intent, Robot execution, keyword provider, external state, and evidence.
Cleanup: delete only the disposable
rf-ch01-lab directory you created. Do not use
recursive-delete commands against an unverified path.
12. Knowledge check
Does Robot Framework core contain a browser driver?
No. Browser automation comes from an external library such as SeleniumLibrary or Browser, plus that library's runtime dependencies. Robot core provides the execution framework.
Why is a BDD-style Given step not a separate BDD
execution engine?
Robot Framework still performs its normal keyword resolution. Given/When/Then/And/But can be treated as prefixes during matching; the underlying execution remains keyword based.
What is the difference between output.xml and
log.html?
output.xml is machine-readable result data.
log.html is a rendered, detailed human diagnostic
view generated from Robot results.
A test passed, but the CI runner uploaded no artifacts. Is the automation evidence model complete?
No. A pass status is useful, but reproducible evidence also requires retained result artifacts and enough version/environment context to interpret the run.
13. Summary and next step
Robot Framework is a generic keyword-driven execution engine for tests and tasks. It parses structured data, resolves user and library keywords, delegates domain work to libraries, and records execution evidence. You now have the ownership model needed to avoid treating every external session, variable, task, and result as one undifferentiated "Robot state." Lesson 2 turns that model into a guided workflow and traces one keyword call all the way to result artifacts.
Further reading and current primary references
Version-sensitive statements in this lesson were checked on 2026-08-30. The mandatory path uses Robot Framework 7.4.2, the current stable release at the time of authoring. Robot Framework 7.5b1 is a pre-release and is not required here. Re-check these sources before pinning versions in a new environment.
- Robot Framework 7.4.2 User Guide
- BuiltIn library 7.4.2 documentation
- RFCP syllabus — purpose and use cases
- RFCP syllabus — architecture of Robot Framework
- RFCP syllabus — basic syntax and structure
- RFCP syllabus — keyword-driven, behavior-driven, and data-driven styles
- Robot Framework releases
- Robot Framework on PyPI
Keep the academy open
Support free, practical DevOps education.
Every lesson is designed to remain readable in a browser, downloadable from GitHub, and usable without a paid learning platform. Contributions help expand and maintain the curriculum.
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0
Send only Ethereum/ERC-20 compatible assets to this
address.