Friday, June 27, 2025

Give a Name for the Base64 Image in an Extent Report

 

I read the below question in Testing Mini Bytes community.

Hi All, I am using extents reports in my c# automation framework. I am trying to attach the screenshot but it is always showing with name as base64img. Any idea how to overwrite that base64img to customised text?


Capturing a Screenshot in the Test Run

With the Extent report, one can capture the image of screen during the test run.  This capture can be on certain condition or state being met.  That is, it can be -- on fail of a particular action; in a transition between the states; etc.

In an Extent report, when the image is captured as Base64 image and the thumbnail is set to false, the images captured will have name "base64img".  Clicking on this, I see the respective image.  


No Customized Text as Name for Base64 Image

Say, a Extent report has 10 images captured as Base64 image with thumbnail false.  All these 10 different images will have the same name -- base64img.

  • This can be more chaotic to interpret when a test run has captured more than one Base64 image, and, all have the same name -- base64img.
  • Do you see that? 
    • How do you know what is that image without opening it just by reading base64img?
    • That's hard and you have to make additional clicks to know what is in each image!
      • Is this a better use of time of you who is reading the Extent report?


Naming the Base64 Image in an Extent Report

I see, the semantics in C# should also be similar to what I'm sharing below.  




The above gist should help to have a customized text given for each captured Base64 image.

In this case, the captured Base64 image name will be the customized text "Resend_OTP_Button_Not_Available" and not base64img.  This makes it more contextual and relatable for the reader of an Extent report.



No comments:

Post a Comment

Please, do write your comment on the read information. Thank you.