How to add screenshot and video report into allure report?

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.

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 that can do that, the keyword documentation is here, I’ve not used it myself but there some info about it here. 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.

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

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 :crossed_fingers:

Dave.

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

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 :crossed_fingers:

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.

Thanks dave, will update in sometime

Hi Bala,

A quick Google Search for “allure_robotframework listener file” brought me to here:

Section 1.2. 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 and Also This issue #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.