-
Notifications
You must be signed in to change notification settings - Fork 139
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
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
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
Labels
bugSomething isn't workingSomething isn't working

