Install & Compatibility
Where this runs
tested against v2.16.0 · 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.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.8MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 1.7s · import 0.000s · 19MB
17MB installed
● package 17MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
AllureLibrary
✓ from AllureLibrary import allure_library
✗ from AllureLibrary import AllureLibrary
attach
✓ from AllureLibrary import attach
attach_file
✓ from AllureLibrary import attach_file
This quickstart demonstrates the full lifecycle: creating a minimal Robot Framework test, executing it with the Allure listener to generate raw results, and then processing those results into an interactive HTML report using the Allure command-line tool. Ensure `robotframework`, `allure-robotframework`, and `allure-commandline` are installed.
import os
import subprocess
# 1. Create a dummy Robot Framework test file
robot_file_content = """
*** Settings ***
Library OperatingSystem
Library allure_robotframework.library_api
*** Test Cases ***
Simple Allure Robot Test
Log To Console Starting Allure Robot Test
allure_robotframework.library_api.step This is an Allure step
Create File test_attachment.txt Some attachment content
allure_robotframework.library_api.attach test_attachment.txt
Log To Console Test completed!
"""
robot_file_path = "example.robot"
with open(robot_file_path, 'w') as f:
f.write(robot_file_content)
print(f"Created {robot_file_path}")
# 2. Run Robot Framework tests with the Allure listener
print("\n--- Running Robot Framework tests ---")
# This command executes Robot Framework, using allure-robotframework as a listener.
# It generates raw Allure results in the 'allure-results' directory.
try:
subprocess.run(
["robot", "--listener", "allure_robotframework", robot_file_path],
check=True,
capture_output=True,
text=True
)
print("Robot Framework tests executed successfully. Allure results generated in 'allure-results'.")
except subprocess.CalledProcessError as e:
print(f"Error running Robot Framework tests: {e}")
print(f"Stdout:\n{e.stdout}")
print(f"Stderr:\n{e.stderr}")
print("Please ensure 'robotframework' and 'allure-robotframework' are installed.")
exit(1)
except FileNotFoundError:
print("Error: 'robot' command not found. Please install Robot Framework.")
exit(1)
# 3. Generate the Allure report
print("\n--- Generating Allure report ---")
# This command processes the raw results and creates a human-readable HTML report.
# It requires the 'allure-commandline' tool to be installed.
report_dir = "allure-report"
try:
subprocess.run(
["allure", "generate", "allure-results", "-o", report_dir, "--clean"],
check=True,
capture_output=True,
text=True
)
print(f"Allure report generated successfully in '{report_dir}'.")
print(f"To view the report, open '{os.path.abspath(report_dir)}/index.html' in your browser, or run 'allure open {report_dir}'.")
except FileNotFoundError:
print("\nError: 'allure' command not found.")
print("Please install the Allure command-line tool. See https://docs.qameta.io/allure/#_install_a_commandline for instructions.")
exit(1)
except subprocess.CalledProcessError as e:
print(f"Error generating Allure report: {e}")
print(f"Stdout:\n{e.stdout}")
print(f"Stderr:\n{e.stderr}")
exit(1)
# Optional cleanup:
# os.remove(robot_file_path)
# os.remove("test_attachment.txt")
# import shutil
# shutil.rmtree("allure-results", ignore_errors=True)
# shutil.rmtree(report_dir, ignore_errors=True)
Debug
Known issues
gotchaThe Allure command-line tool (`allure`) is not automatically installed with `allure-robotframework`. It is crucial for generating the final HTML report from the raw JSON results.fixInstall the Allure command-line tool separately. For example: `npm install -g allure-commandline` (Node.js required) or `brew install allure` (macOS).
affects: All versions
gotchaThe `allure-results` directory contains raw JSON data from test execution, not the human-readable report. These files must be processed by the Allure command-line tool to create the final HTML report.fixAfter running tests, execute `allure generate allure-results -o allure-report --clean` (replace `allure-report` with your desired output directory).
affects: All versions
gotchaWhen running Robot Framework, ensure the Allure listener is correctly specified with `--listener allure_robotframework`. Typos or incorrect capitalization will prevent results from being collected.fixAlways use the exact listener name: `robot --listener allure_robotframework your_tests.robot`.
affects: All versions
breakingOlder versions of `allure-robotframework` might not be compatible with newer versions of Robot Framework (e.g., Robot Framework 4.0 removed deprecated APIs which could break older listeners).fixAlways use a compatible version. Refer to the `allure-python` GitHub page for current compatibility with Robot Framework versions. Upgrade `allure-robotframework` to the latest stable release for best compatibility.
affects: <2.12.0 with RF 4.0+
Upgrade
Version history
2.16.0latest on PyPI · released Apr 27, 2026
Audit
Dependencies
allure-python-commonsrequiredCore dependency for all Allure Python integrations.
robotframeworkrequiredThe core test automation framework that this library integrates with.