Skip to content
Allure report logoAllure Report
Main Navigation ModulesDocumentationStart

English

Español

English

Español

Appearance

Sidebar Navigation

Introduction

Install & Upgrade

Install for Windows

Install for macOS

Install for Linux

Install for Node.js

Upgrade Allure

Getting started

How to view a report

Improving readability of your test reports

Improving navigation in your test report

Features

Test steps

Attachments

Test statuses

Sorting and filtering

Defect categories

Visual analytics

Test stability analysis

History and retries

Timeline

Export to CSV

Export metrics

Guides

JUnit 5 parametrization

JUnit 5 & Selenide: screenshots and attachments

JUnit 5 & Selenium: screenshots and attachments

Setting up JUnit 5 with GitHub Actions

Pytest parameterization

Pytest & Selenium: screenshots and attachments

Pytest & Playwright: screenshots and attachments

Pytest & Playwright: videos

Playwright parameterization

How it works

Overview

Test result file

Container file

Categories file

Environment file

Executor file

History files

Integrations

Azure DevOps

Bamboo

GitHub Actions

Jenkins

JetBrains IDEs

TeamCity

Visual Studio Code

Frameworks

Behat

Getting started

Configuration

Reference

Behave

Getting started

Configuration

Reference

Codeception

Getting started

Configuration

Reference

CodeceptJS

Getting started

Configuration

Reference

Cucumber.js

Getting started

Configuration

Reference

Cucumber-JVM

Getting started

Configuration

Reference

Cucumber.rb

Getting started

Configuration

Reference

Cypress

Getting started

Configuration

Reference

Jasmine

Getting started

Configuration

Reference

JBehave

Getting started

Configuration

Reference

Jest

Getting started

Configuration

Reference

JUnit 4

Getting started

Configuration

Reference

JUnit 5

Getting started

Configuration

Reference

Mocha

Getting started

Configuration

Reference

Newman

Getting started

Configuration

Reference

NUnit

Getting started

Configuration

Reference

PHPUnit

Getting started

Configuration

Reference

Playwright

Getting started

Configuration

Reference

pytest

Getting started

Configuration

Reference

Pytest-BDD

Getting started

Configuration

Reference

Reqnroll

Getting started

Configuration

Reference

REST Assured

Getting started

Configuration

Robot Framework

Getting started

Configuration

Reference

RSpec

Getting started

Configuration

Reference

SpecFlow

Getting started

Configuration

Reference

Spock

Getting started

Configuration

Reference

TestNG

Getting started

Configuration

Reference

Vitest

Getting started

Configuration

Reference

WebdriverIO

Getting started

Configuration

Reference

xUnit.net

Getting started

Configuration

Reference

On this page

Getting started with Allure Robot Framework ​

Allure Robot Framework pypi latest version

Generate beautiful HTML reports using Allure Report and your Robot Framework tests.

Allure Report Robot Framework Example

Setting up ​

1. Prepare your project ​

  1. Install the Allure Report command-line tool, if it is not yet installed in your operating system. Note that Allure Report requires Java, see the installation instructions.

  2. Open a terminal and go to the project directory. For example:

    bash
    cd /home/user/myproject
  3. If necessary for your system configuration, activate the virtual Python environment for your project.

    For example, if the project uses a venv environment, the command to activate it may look like this:

    bash
    source .venv/bin/activate

    This step is not necessary if you are using the system Python environment.

  4. Install the Allure Robot Framework adapter.

    bash
    pip install allure-robotframework

2. Run tests ​

When running your tests, add the --listener allure_robotframework command-line argument. This will allow Allure Robot Framework to collect test results into the output/allure directory. To specify another path for the test results directory, add it after the listener name, separated by a colon.

If you are going to use the test plans, also add the --prerunmodifier allure_robotframework.testplan argument.

bash
python -m robot \
  --listener allure_robotframework \
  --prerunmodifier allure_robotframework.testplan \
  ./my_tests
bash
python -m robot \
  --listener allure_robotframework:allure-results \
  --prerunmodifier allure_robotframework.testplan \
  ./my_tests

3. Generate a report ​

Finally, convert the test results into an HTML report. This can be done by one of two commands (replace output/allure with your path to test results):

  • allure generate output/allure processes the test results and saves an HTML report into the allure-report directory. To view the report, use the allure open command.

    Use this command if you need to save the report for future reference or for sharing it with colleagues.

  • allure serve output/allure creates the same report as allure generate output/allure but puts it into a temporary directory and starts a local web server configured to show this directory's contents. The command then automatically opens the main page of the report in a web browser.

    Use this command if you need to view the report for yourself and do not need to save it.

Writing tests ​

The Allure Robot Framework adapter extends the standard reporting features of Robot Framework by providing additional capabilities for crafting more informative and structured tests. This section highlights key enhancements that can be utilized:

  • Metadata Annotation: Enhance test reports with descriptions, links, and other metadata.
  • Test Organization: Structure your tests into clear hierarchies for better readability and organization.
  • Step Division: Break down keywords into smaller test steps for easier understanding and maintenance.
  • Parametrized Tests: Clearly describe the parameters for parametrized tests to specify different scenarios.
  • Attachments: Automatically capture screenshots and other files during test execution.
  • Test Selection: Use a test plan file to select which tests to run, allowing for flexible test execution.
  • Environment Details: Include comprehensive environment information to accompany the test report.

In most cases, you need to indicate to Allure Robot Framework that a certain property needs to be assigned to the test result. Most properties can be assigned in the suite file, via the Decorators API or via the Runtime API.

  • Suite file: use the [Tags], Set Tags or Test Tags keywords in the suite files (see Tagging test cases in the Robot Framework documentation) to assign various data to tests.

    When using the [Tags] or Test Tags keyword, the data is guaranteed to be added to the test result regardless of how the test itself runs.

    When using the Set Tags keyword, it is recommended to put it as close to the beginning of the test as possible. This way, the data will be added even if the test fails early.

    You can use either a colon or an equal sign to separate the value from the name, e.g., allure.label.epic:Web interface is identical to allure.label.epic=Web interface.

  • Decorators API: add a Python decorator to a method that implements a Robot Framework keyword. When using this approach, the data is guaranteed to be added regardless of how the keyword itself runs.

  • Runtime API: use Allure's functions to add data to the test result during the execution of a keyword. This approach allows for constructing the data dynamically.

    Note that it is recommended to call the Allure's functions as close to the beginning of the implementation as possible, e.g., in the first lines of the first keyword's implementation. This way, the data will be added even if the test fails early.

Specify description, links and other metadata ​

There is a lot of metadata you can add to each test so that it would appear in the report. See the reference for more details.

*** Test Cases ***

Test Authentication
    [Tags]
    ...  allure.label.owner:John Doe
    ...  allure.label.severity:critical
    # ...
python
import allure
from robot.api.deco import keyword

@keyword('Test Authentication')
@allure.label('owner', 'John Doe')
@allure.severity('critical')
def test_authentication():
    ...
python
import allure
from robot.api.deco import keyword

@keyword('Test Authentication')
def test_authentication():
    allure.dynamic.label('owner', 'John Doe')
    allure.dynamic.severity('critical')
    ...

Organize tests ​

As described in Improving navigation in your test report, Allure supports multiple ways to organize tests into hierarchical structures. Allure Robot Framework provides functions to assign the relevant fields to tests either by adding decorators or “dynamically” (same as for the metadata fields).

To specify a test's location in the behavior-based hierarchy:

*** Test Cases ***

Test Authentication
    [Tags]
    ...  allure.label.epic:Web interface
    ...  allure.label.feature:Essential features
    ...  allure.label.story:Authentication
    # ...
python
import allure
from robot.api.deco import keyword

@keyword('Test Authentication')
@allure.epic('Web interface')
@allure.feature('Essential features')
@allure.story('Authentication')
def test_authentication():
    ...
python
import allure
from robot.api.deco import keyword

@keyword('Test Authentication')
def test_authentication():
    allure.dynamic.epic('Web interface')
    allure.dynamic.feature('Essential features')
    allure.dynamic.story('Authentication')
    ...

To specify a test's location in the suite-based hierarchy:

*** Test Cases ***

Test Authentication
    [Tags]
    ...  allure.label.parentSuite:Web interface
    ...  allure.label.suite:Essential features
    ...  allure.label.subSuite:Authentication
    # ...
python
import allure
from robot.api.deco import keyword

@keyword('Test Authentication')
@allure.parent_suite('Web interface')
@allure.suite('Essential features')
@allure.sub_suite('Authentication')
def test_authentication():
    ...
python
import allure
from robot.api.deco import keyword

@keyword('Test Authentication')
def test_authentication():
    allure.dynamic.parent_suite('Web interface')
    allure.dynamic.suite('Essential features')
    allure.dynamic.sub_suite('Authentication')
    ...

To specify a test's location in the package-based hierarchy:

*** Test Cases ***

Test Authentication
    [Tags]
    ...  allure.label.package:org.example
    ...  allure.label.testMethod:test_authentication()
    # ...
python
import allure
from robot.api.deco import keyword

@keyword('Test Authentication')
@allure.label('package', 'org.example')
@allure.label('testMethod', 'test_authentication()')
def test_authentication():
    ...
python
import allure
from robot.api.deco import keyword

@keyword('Test Authentication')
def test_authentication():
    allure.dynamic.label('package', 'org.example')
    allure.dynamic.label('testMethod', 'test_authentication()')
    ...

Divide keywords into steps ​

Allure Robot Framework displays each keyword as a separate step in the test report. It also provides two ways of creating sub-steps from within the Python code: “decorated steps” and “context steps”, see the reference.

python
import allure
from robot.api.deco import keyword

@keyword('Test Authentication')
def test_authentication():
    navigate_to_the_website()
    for login, password in [['johndoe', 'qwerty'],
                            ['janedoe', 'pass123']]:
        try_to_authenticate(login, password)


@allure.step('Navigate to the website')
def navigate_to_the_website():
    ...


@allure.step('Try to authenticate as {login}')
def try_to_authenticate(login, password):
    ...
python
import allure
from robot.api.deco import keyword

@keyword('Test Authentication')
def test_authentication():
    with allure.step('Navigate to the website'):
        ...

    for login, password in [['johndoe', 'qwerty'],
                            ['janedoe', 'pass123']]:
        with allure.step(f'Try to authenticate as {login}'):
            ...

Describe parametrized tests ​

When you pass arguments to a keyword in the suite file, Allure Report displays them as parameters for the corresponding step, see the reference.

*** Keywords ***
Try To Authenticate
    [Arguments]    ${login}    ${password}
    Log To Console    Trying to authenticate with ${login} and ${password}...
    # ...

*** Test Cases ***

Test Authentication
    Try To Authenticate    [email protected]    qwerty
    Try To Authenticate    [email protected]    pass123

Attach screenshots and other files ​

You can attach any sorts of files to your Allure report. For example, a popular way to make a report easier to understand is to attach a screenshot of the user interface at a certain point.

Allure Robot Framework provides various ways to create an attachment, both from existing files or generated dynamically, see the reference.

*** Settings ***
Library     AllureLibrary
Library     RequestsLibrary

*** Test Cases ***
Test Authentication
    # ...

    ${response}=  GET  https://example.com/image.png
    Attach  ${response.content}
    ...     name=Image  attachment_type=PNG

    Attach File  /path/to/image.png
    ...          name=Image  attachment_type=PNG
python
import allure
import requests
from robot.api.deco import keyword


@keyword('Test Authentication')
def test_authentication():
    ...

    png_bytes = requests.get('https://example.com/image.png').content
    allure.attach(png_bytes, name='img', attachment_type=allure.attachment_type.PNG)

    allure.attach.file('/path/to/image.png', name='img', attachment_type=allure.attachment_type.PNG)

Select tests via a test plan file ​

If the --prerunmodifier allure_robotframework.testplan argument is used and the ALLURE_TESTPLAN_PATH environment variable points to an existing file, Robot Framework will only run tests listed in this file.

Here's an example of running tests according to a file named testplan.json:

bash
export ALLURE_TESTPLAN_PATH=testplan.json
python -m robot \
  --listener allure_robotframework \
  --prerunmodifier allure_robotframework.testplan \
  ./my_tests
powershell
$Env:ALLURE_TESTPLAN_PATH = "testplan.json"
python -m robot \
  --listener allure_robotframework \
  --prerunmodifier allure_robotframework.testplan \
  ./my_tests

Environment information ​

For the main page of the report, you can collect various information about the environment in which the tests were executed.

For example, it is a good idea to use this to remember the OS version and Python version. This may help the future reader investigate bugs that are reproducible only in some environments.

Allure Report Environments Widget

To provide environment information, put a file named environment.properties into the test results directory (output/allure by default) after running the tests. See the example in Environment file.

Note that this feature should be used for properties that do not change for all tests in the report. If you have properties that can be different for different tests, consider using Parametrized tests.

Pager
Previous pageConfiguration
Next pageConfiguration
Powered by

Join our newsletter

Allure TestOps
  • Overview
  • Why choose us
  • Cloud
  • Self-hosted
  • Success Stories
Company
  • Documentation
  • Blog
  • About us
  • Contact
  • Events
© 2025 Qameta Software Inc. All rights reserved.