Skip to content
This repository was archived by the owner on Jul 17, 2020. It is now read-only.
This repository was archived by the owner on Jul 17, 2020. It is now read-only.

v3.0.1 Extent Report - Screenshots only appear for the most recently executed test #726

Description

@savvyaxnjxn

I've really enjoyed getting to know the Extent Report tool over the past few weeks! I've plunged in with the latest v3.0.1 and have used it to run back-to-back test cases for hours on end with Selenium WebDriver and our Jenkins CI Server. As expected, the reports that are produced (both locally and from the CI Server) take and store every screenshot that is coded. However, when a new report is appended (.setAppendExisting(true)) the html report file wipes out the tags that contain the data-featherlight img reference from the previous report and the screenshots only appear for the most recently executed test.

If it helps, the method I'm using to make the entry in my log is as follows (inputs are my WebDriver and the Test I'm appending the screenshot to):

public void captureAndDisplayScreenShot(WebDriver ldriver, ExtentTest eTest){
        String extentReportImage = "../extentReport/screenshots/" + System.currentTimeMillis() + ".png";
        // Take screenshot and store as a file format
        File src=((TakesScreenshot)ldriver).getScreenshotAs(OutputType.FILE);
        try {
            // now copy the  screenshot to desired location using copyFile method
            FileUtils.copyFile(src, new File(extentReportImage));
            eTest.log(Status.INFO,"Screenshot from : " + extentReportImage).addScreenCaptureFromPath(extentReportImage);
        } catch (IOException e)
        {
            System.out.println(e.getMessage());
        }
    }

Please advise if there is anything more I can provide! Thank you again for your work on a great product; the shop loves it!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions