public void takeScreenshot ( String filename ) throws IOException { File screenshot = ( ( TakesScreenshot ) driver ) . getScreenshotAs ( OutputType . FILE ) ; FileUtils . copyFile ( screenshot , new File ( filename ) ) ; }
Takes a screenshot of the current screen .