How to add screenshot in Allure Report for Failure Test Cases - Allure Repot

Getting below error.
Please find the attachment for reference.
Screenshot 2024-05-07 092803

Hi Muralikrishna,

I don’t know how your Allure report gets generated? so hopefully someone more familiar with Allure can jump in and give you a better answer. but this generic answer might help you solve the problem

  • Robot generates an output.xml file and 2 html files from this xml file. It also optionally outputs a xunit.xml file that is often used to import results into other systems (maybe Allure uses this?).

  • In the same output folder as these files is where the screen shots are usually saved, though every library does things a bit differently, it appears you are using selenium library? selenium library does put the screen shots in the same directory

  • In the xml and html files most libraries give a relative path to the images (relative to the xml file), again selenium library does give the relative path.

  • To get your images to display they’ll need to be uploaded to your Allure server along as part of the result, this may also involve changing the image path to the screenshots as part of the import process, because if you just uploaded the images to /data/attachments on your server the screenshots from 1 run will overwrite the previous runs (or even other unrelated tests) and then your logs won’t make sense.

I hope this helps,