# How to add screenshot and video report into allure report?

**URL:** https://forum.robotframework.org/t/how-to-add-screenshot-and-video-report-into-allure-report/5841
**Category:** Robot Framework
**Created:** [16 June 2023 07:04 UTC](https://forum.robotframework.org/t/how-to-add-screenshot-and-video-report-into-allure-report/5841 "2023-06-16T07:04:00Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![venkateshshah](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/venkateshshah/32/2737_2.png) [@venkateshshah](https://forum.robotframework.org/u/venkateshshah)
#### Post date: [16 June 2023 07:04 UTC](https://forum.robotframework.org/t/how-to-add-screenshot-and-video-report-into-allure-report/5841/1 "2023-06-16T07:04:00Z")

</div>

Actually, the problem is whenever I run the test case and generated allure report, I have the screenshot of failed test scenario. But it is not showing the screenshot of the passed test case and video report inside the allure report.

---

<div class="post-metadata">

### Author: ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)
#### Post date: [16 June 2023 09:41 UTC](https://forum.robotframework.org/t/how-to-add-screenshot-and-video-report-into-allure-report/5841/2 "2023-06-16T09:41:25Z")

</div>

Hi Venkatesh,

Firstly I’m not sure what you mean by “allure report”? Robot framework doesn’t have an option to generate an allure report that I know of. The default report is a html file, but there is an xunit report option that might be turned into an allure report by some other software?

The fact that you get screenshots on failed test steps is a good sign, For most libraries that take screenshots by default you only get screenshots on fail, I don’t know of any library that takes screen shots on pass because that would take a lot of disk space unnecessarily.

Likewise none of the libraries take video by default.

You can however often configure your test cases to take screen shots at important stages as it progresses, but the keyword for doing that varies depending on which library you are using, you didn’t mention which library you are using so you’ll need to advise which library you are using if you want more help with that.

As for taking video of your test case, there’s the [ScreenCapLibrary](https://github.com/rticau/ScreenCapLibrary) that can do that, the [keyword documentation is here](https://rticau.github.io/ScreenCapLibrary/ScreenCapLibrary.html), I’ve not used it myself but there some info about it [here](https://forum.robotframework.org/t/question-about-how-to-take-video-in-headless-mode-vnc/4370/3). ScreenCapLibrary can also take screen shots for you if the library you’re using doesn’t have a keyword for that.

Hopefully this helps,

Dave.

---

<div class="post-metadata">

### Author: ![venkateshshah](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/venkateshshah/32/2737_2.png) [@venkateshshah](https://forum.robotframework.org/u/venkateshshah)
#### Post date: [16 June 2023 10:05 UTC](https://forum.robotframework.org/t/how-to-add-screenshot-and-video-report-into-allure-report/5841/3 "2023-06-16T10:05:16Z")

</div>

![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/2X/e/e93bd5b8c5be4001f96d57b6c099a2c353ce2fbb.png)

I want screenshot should be visible inside allure report. Can you help on this?

---

<div class="post-metadata">

### Author: ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)
#### Post date: [16 June 2023 10:15 UTC](https://forum.robotframework.org/t/how-to-add-screenshot-and-video-report-into-allure-report/5841/4 "2023-06-16T10:15:19Z")

</div>

Hi Venkatesh,

As I mentioned that allure report is not created by Robot framework, however the part in the right frame of the allure report looks like the standard html report from robot framework with some formatting applied.

I can see from your screen shot that it appears you are using SeleniumLibrary, so you can add the keyword `Capture Page Screenshot` anywhere in your test where you want to capture a screenshot and hopefully that will show up in your report 🤞

Dave.

---

<div class="post-metadata">

### Author: ![Bala](https://avatars.discourse-cdn.com/v4/letter/b/94ad74/32.png) [@Bala](https://forum.robotframework.org/u/Bala)
#### Post date: [3 July 2023 05:31 UTC](https://forum.robotframework.org/t/how-to-add-screenshot-and-video-report-into-allure-report/5841/5 "2023-07-03T05:31:19Z")

</div>

HI Dave,  
we use the screenshot but still the report is not able to show it. I can see the screenshots in the default report but not in the Allure report.

**COMMAND USED FOR EXECUTION**  
\*_robot --outputdir D:\AUTO\TPIHCM\output --listener ‘allure\_robotframework:./output’ D:\AUTO\TPIHCM\Specs\*_

**allure serve D:\AUTO\TPIHCM\output**

I have also modified the allure.properties file as below but the allure report is not able to get the png files from the output folder.

# Enable the display of screenshots in the report

allure.attachment.reporter.enabled=true  
allure.attachments.directory=D:/AUTO/TPIHCM/output

---

<div class="post-metadata">

### Author: ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)
#### Post date: [3 July 2023 07:18 UTC](https://forum.robotframework.org/t/how-to-add-screenshot-and-video-report-into-allure-report/5841/6 "2023-07-03T07:18:04Z")

</div>

Hi Bala,

As I mentioned that allure report is not created by Robot framework, but from your comment I see something I didn’t know before, the allure report is created by a listener (`--listener ‘allure_robotframework`), allure\_robotframework should be a python file, so you should be able to open it with a text editor and find out who created it it.

When you find who created the allure\_robotframework listener file, they should be able to help you with your issue 🤞

Alternatively perhaps you already know where the allure\_robotframework listener file comes from? If it’s a website, you could share that information here as that might give me more information to help you.

Dave.

---

<div class="post-metadata">

### Author: ![Bala](https://avatars.discourse-cdn.com/v4/letter/b/94ad74/32.png) [@Bala](https://forum.robotframework.org/u/Bala)
#### Post date: [3 July 2023 07:21 UTC](https://forum.robotframework.org/t/how-to-add-screenshot-and-video-report-into-allure-report/5841/7 "2023-07-03T07:21:44Z")

</div>

Thanks dave, will update in sometime

---

<div class="post-metadata">

### Author: ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)
#### Post date: [3 July 2023 07:34 UTC](https://forum.robotframework.org/t/how-to-add-screenshot-and-video-report-into-allure-report/5841/8 "2023-07-03T07:34:21Z")

</div>

Hi Bala,

A quick Google Search for “allure\_robotframework listener file” brought me to here:

- [allure-robotframework · PyPI](https://pypi.org/project/allure-robotframework/), following the homepage link to:
- [GitHub - allure-framework/allure-python: Allure integrations for Python test frameworks](https://github.com/allure-framework/allure-python), and then the Read more link under Robot Framework to:
- [allure-python/allure-robotframework/README.rst at master · allure-framework/allure-python · GitHub](https://github.com/allure-framework/allure-python/blob/master/allure-robotframework/README.rst), I then followed the Documentation link to:
- [Allure Framework](https://docs.qameta.io/allure-report/)

Section [1.2. Get Help](https://docs.qameta.io/allure-report/#_get_help) gides you to several places where you can get help with this listener.

i had a look through their github issues and found this [issue #1096](https://github.com/allure-framework/allure2/issues/1096) and Also This [issue #476](https://github.com/allure-framework/allure-python/issues/476), so it seems what you are wanting is a feature that’s in the process ob being implemented in that listener but not complete yet.

Perhaps you can contact that project is find out how you can help them.

Sorry I can’t be more help than that, I have no involvement with this project.

Dave.

---

<div class="post-metadata">

### Author: ![Renuka.U](https://avatars.discourse-cdn.com/v4/letter/r/d26b3c/32.png) [@Renuka.U](https://forum.robotframework.org/u/Renuka.U)
#### Post date: [14 February 2025 07:25 UTC](https://forum.robotframework.org/t/how-to-add-screenshot-and-video-report-into-allure-report/5841/9 "2025-02-14T07:25:24Z")

</div>

Even i have the similar issue but my case is allure report is unable to display for my failed test case.  
But the screenshot is captured and saved in my folder but unable to see it in the allure report.

---

<div class="post-metadata">

### Author: ![RysZ](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/rysz/32/4570_2.png) [@RysZ](https://forum.robotframework.org/u/RysZ)
#### Post date: [20 February 2025 13:00 UTC](https://forum.robotframework.org/t/how-to-add-screenshot-and-video-report-into-allure-report/5841/10 "2025-02-20T13:00:56Z")

</div>

You need to use Attach File as here:,

> <https://github.com/allure-framework/allure-python/blob/master/allure-robotframework/src/library/allure_library.py#L18>

something like this:

Library AllureLibrary  
…  
${source}= provide path or use taking screenshot function  
Attach File ${source} … other args
