Search code examples
javaselenium-webdriverscreenshotextentreportsselenium-extent-report

How to increase the size of the Screenshot Thumbnails in ExtentReports 4.0.9


I'm trying to customize ExtentReports 4.0.9 When I'm opening report after test fails, It displays screenshot as very small thumbnails. How can i increase size of the Thumbnail.

I've tried extent-config.xml

<!-- custom styles -->
    <styles>
      <![CDATA[
        .featherlight-image {   border: 1px solid #f6f7fa;   cursor: zoom-in;    width: 100px; }
      ]]>
    </styles>

Screenshot is : https://i.sstatic.net/HQ37j.jpg

but it didn't work. Please suggest How can i Increase the size of thumbnail.


Solution

  • I have researched about it and finally got the solution for my problem. I have added some CSS code from htmlreported of Extent Report 4.

    htmlReporter.config().setCSS(".r-img { width: 30%; }");
    report=new ExtentReports();
    report.attachReporter(htmlReporter);
    

    I have added above code when configuring ExtentReport.

    I hope it will work for someone who face the same situation.