Just a piecec pf code to create a screen shot:
private void takeScreenShot(RuntimeException e, String fileName) {
File screenShot = ((TakesScreenshot)
driver).getScreenshotAs(OutputType.FILE);
try {
FileUtils.copyFile(screenShot, new File(fileName + ".png"));
} catch (IOException ioe) {
throw new RuntimeException(ioe.getMessage(), ioe);
}
throw e;
}
On Sunday, September 2, 2012 8:22:15 AM UTC+2, David Tishkoff wrote:
>
> Hello,
>
> I'm using Rake + RSpec + Selenium-WebDriver for the web testing, Is
> there a way to create html report with the screenshot generated on
> failure? Would really appreciate your help!
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> [email protected] <javascript:>
> http://rubyforge.org/mailman/listinfo/rspec-users
>
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users