public void takeScreenShotOnFailure(ITestResult testResult, String destination) throws IOException{
if (testResult.getStatus() == ITestResult.FAILURE) {
System.out.println(testResult.getStatus());
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File(destination));
}
}
}
i am extend above class
public class invoice extends Common Class{
@AfterMethod
public void takeScreenShotOnFailure2() throws IOException{
String y = "//Users/dimuth/Documents/Hiveage_bugs_screenshots(Selenium)//testScreenShot.jpg";
ITestResult test = null;
login l = new login();
l.takeScreenShotOnFailure(test, y);
}
}
You would need to show the complete stacktrace of the error you encountered.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/63425d0b-8ae9-4f75-923a-b52f1e21b0d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZLkf10ZmyR%2B98r15YTxzTYr15W7WnDVbEqgew8LdzM-_eQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/D498FA5B-1EE4-4086-A94B-CD65C8CC52EC%40lazeryattack.com.