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

Javix s.cambour at gmail.com
Mon Sep 3 12:00:08 UTC 2012


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 
> rspec... at rubyforge.org <javascript:> 
> http://rubyforge.org/mailman/listinfo/rspec-users 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20120903/394a9506/attachment-0001.html>


More information about the rspec-users mailing list