try {
File tmpfile = takeScreenShotOnBrowser(browser, OutputType.FILE);
try {
FileHandler.copy(tmpfile, file);
} catch (IOException e) {
throw new CrawljaxException(e);
}
} catch (WebDriverException e) {
throw wrapWebDriverExceptionIfConnectionException(e);
}
}