Skip to content

Why i'm getting screenshot thumbnail blank in V 4.1.1? #119

@chetanJTH

Description

@chetanJTH

I just updated my extent report v 3.1.5 to 4.1.1.
Now i'm not getting screenshot perfectly on report > v4.
I'm using > ExtentSparkreporter

ScreenShot of V3.1.5
3 1 5

ScreenShot of V4.1.1
4 1 1

I need to click each screenshot to check images.

code for capturing image as below

public static String Screenshot(String imageName)  {
        try {
            File scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
            String pathName = Utils.createDir(Utils.getReportDir() + "/Images");
            File Dest = new File(pathName, System.currentTimeMillis() + ".png");
            FileUtils.copyFile(scrFile, Dest);
            String[] relativePath = Dest.toString().split("reports");
            screenshotPath = "../" + relativePath[1];
        } catch (IOException e) {
            e.printStackTrace();
        }
        return screenshotPath;
    }

code for add image in log

public static void captureScreenShot(){
        String screenShotPath = Screenshot("");
        try {
            test.addScreenCaptureFromPath(screenShotPath);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

help to resolve issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions