Robot Framework is a generic open-source automation framework for acceptance testing, acceptance test-driven development (ATDD), and robotic process automation (RPA). It uses a keyword-driven approach, allowing for easy-to-read test cases. The project is actively maintained with frequent bug fix releases (e.g., 7.4.x series) and feature releases (e.g., 7.4, 7.3) typically a few times a year. The current version is 7.4.2.
Install & Compatibility
Where this runs
tested against v7.4.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.925 runs
installs and imports cleanly · install 0.0s · import 0.670s · 23.8MB
glibcpy 3.10–3.925 runs
installs and imports cleanly · install 1.9s · import 0.657s · 24MB
22MB installed
● package 22MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
The `robot.run` function is the standard programmatic entry point for executing Robot Framework tests from Python. `robot.main()` is an older, less flexible approach.
from robot import run
The `keyword` decorator for creating custom Python keywords resides specifically in `robot.api.deco`.
from robot.api.deco import keyword
To access Robot Framework's built-in keywords (e.g., Log, Should Be Equal) from a custom Python library, import `BuiltIn` from `robot.libraries.BuiltIn`.
from robot.libraries.BuiltIn import BuiltIn
This quickstart demonstrates how to programmatically run a Robot Framework test from a Python script. It creates a simple `.robot` file on the fly and then uses `robot.run` to execute it. This is useful for integrating Robot Framework into CI/CD pipelines or other automation scripts. Standard usage often involves running tests directly from the command line using `robot path/to/tests.robot`.
import os
import tempfile
from pathlib import Path
from robot import run
# Create a temporary .robot test file
robot_content = '''
*** Settings ***
Library OperatingSystem
*** Test Cases ***
My First Robot Test
Log To Console Hello from Robot Framework!
Create File ${TEMPDIR}${/}robot_test.txt This is a test file.
File Should Exist ${TEMPDIR}${/}robot_test.txt
Remove File ${TEMPDIR}${/}robot_test.txt
'''
with tempfile.TemporaryDirectory() as tmpdir:
test_file_path = Path(tmpdir) / 'my_test.robot'
test_file_path.write_text(robot_content)
print(f"Running Robot Framework test from: {test_file_path}")
# Execute the test programmatically
# Setting loglevel to DEBUG for verbose output, can be omitted
result = run(test_file_path.as_posix(), loglevel='INFO', outputdir=tmpdir)
if result == 0:
print("Robot Framework test ran successfully!")
else:
print(f"Robot Framework test failed with exit code: {result}")
print(f"Output and logs can be found in: {tmpdir}")
robot --version
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.