Lee
Lee

Reputation: 67

How to install/setup Allure Reporting for robot framework?

I have followed the instructions on git hub and have installed/ran the following commands:

pip install allure-robotframework
pip install robotframework-allure

and in my robot script I have the following statement

Library AllureReportingLibrary

I am running the following command in cmd line:

robot --listener allure_robotframework ./my_robot_test

but it says it cannot find option listner.

Please help. What am I doing wrong?

Upvotes: 1

Views: 9802

Answers (4)

user19380799
user19380799

Reputation: 21

there should be no semicolon. It should be like

robot --listener allure_robotframework ./tests

Upvotes: 0

Rythm Rana
Rythm Rana

Reputation: 36

the way is , first install the package

allure-robotframework or robotframework-allure.

then run the command

robot --listener allure_robotframework ./'path to your robot file'

upon completion of test and generation of data(.html and .json files) use

allure serve ./'path to data generated(folder containing json, html files)'.

this will open the browser and you will be able to see the report.

if it is showing that 'allure' keyword is not recognized , then install allure-commandline in your device, add the path to its batch file which is inside the bin folder to the system environment variables , restart your Pycharm and then it will work fine. I did not face the 'listener not recognized' problem using this command-

robot --listener allure_robotframework ./'path to your robot file'

for any further questions , do comment and I will try to answer with the best of my knowledge.

Upvotes: 0

Konstantin V
Konstantin V

Reputation: 164

The listener parameter should be defined without spaces. In the case when you have spaces it should be defined inside quotes ' ':

robot --listener 'allure_robotframework;./results/allure'

Also:

  • if you do pip install allure-robotframework, then you don't need to install also robotframework-allure.

  • Library AllureReportingLibrary is not necessary to point in your robot file.

  • Once the report is generated you need to execute the following command allure serve ./results/allure, then you will be redirected to the report page on your browser.

For more info: https://docs.qameta.io/allure/#_report_generation

Upvotes: 3

Jakub Sagan
Jakub Sagan

Reputation: 63

I have tried Konstantin solution, but it generate me only a lot of .html files and couple of .json files. In each html file there is a single line of text with robot framework, e.g. keyword name or what variable was returned

robot --listener 'allure_robotframework;./results' ./Tests

Upvotes: 0

Related Questions