[rspec-users] RSpec Selenium Webdriver Html Report with Screenshots

David Tishkoff lists at ruby-forum.com
Mon Sep 3 17:59:21 UTC 2012


Serguei Cambour wrote in post #1074435:
> 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;
>
> }

Thank you for the help, sorry I forgot to mention that I'm using ruby 
and I need screenshots to be included into RSpec html reports.

-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list