Open Hanumant1987 opened 8 years ago
This would probably be due to a path issue. What is the value of DirPath?
Does the screenshot open on the system where it was taken?
Hello Anshoo,
Thanks a lot for you quick support always.
Yes everything was working fine I got checked path and opening from the path.Now I know now why this issue was coming, this was due to it's incompatibility with Mozilla Firefox. Same is working fine with google chrome. So I think we can close this issue now, or you may treat this as bug in firefox environment in windows.
Having said that, I have 2 more doubts as mentioned below.
I really appreciate the great work you did. Thanks a lot.
Hi, i am facing the same problem. When i check the url of the image from the web and copy that to browser the screenshot is shown, but from the extendetreport none. Is there any solution. My code below:
if(result.getStatus()== ITestResult.FAILURE){
String title = screenshots.getLastScreenshot().toString();
String dir = System.getProperty("user.dir")+"/"+title;
test.fail(result.getThrowable());
test.fail("Screenshot of failed test: "+test.addScreenCaptureFromPath(dir));
}
Hello Anshu,
I am using version 3 of extentReports with selenium-Testng Framework. I am using direct code without the testng listener.
I am not able to see screen shot in report. Screen shot is attached but not opening.
Can you help. Please find my code below.
{
TakesScreenshot oScn = (TakesScreenshot) driver; File oScnShot = oScn.getScreenshotAs(OutputType.FILE); File oDest = new File(Path+".png"); try { FileUtils.copyFile(oScnShot, oDest); } catch (IOException e) {System.out.println(e.getMessage());} return Path+".png"; }
// Calling in the test case
String ImagePath1 = ExtentManager.CaptureScreen(driver,TestName, DirPath); test.log(Status.INFO, "ScreenShot below: " + test.addScreenCaptureFromPath(ImagePath1));