public <X> X getScreenshotAs(final OutputType<X> target) { if (proxyInstanciated() && driverCanTakeScreenshots()) { try { return ((TakesScreenshot) getProxiedDriver()).getScreenshotAs(target); } catch (OutOfMemoryError outOfMemoryError) { // Out of memory errors can happen with extremely big screens, and currently Selenium does // not handle them correctly/at all. LOGGER.error("Failed to take screenshot - out of memory", outOfMemoryError); } catch (RuntimeException e) { LOGGER.warn("Failed to take screenshot (" + e.getMessage() + ")"); } } return null; }
public <X> X getScreenshotAs(final OutputType<X> target) { if (proxyInstanciated() && driverCanTakeScreenshots()) { try { return ((TakesScreenshot) getProxiedDriver()).getScreenshotAs(target); } catch (WebDriverException e) { LOGGER.warn("Failed to take screenshot - driver closed already? (" + e.getMessage() + ")"); } catch (OutOfMemoryError outOfMemoryError) { // Out of memory errors can happen with extremely big screens, and currently Selenium does // not handle them correctly/at all. LOGGER.error("Failed to take screenshot - out of memory", outOfMemoryError); } } return null; }
public <X> X getScreenshotAs(final OutputType<X> target) { if (proxyInstanciated() && driverCanTakeScreenshots()) { try { return ((TakesScreenshot) getProxiedDriver()).getScreenshotAs(target); } catch (WebDriverException e) { LOGGER.warn("Failed to take screenshot - driver closed already? (" + e.getMessage() + ")"); } catch (OutOfMemoryError outOfMemoryError) { // Out of memory errors can happen with extremely big screens, and currently Selenium does // not handle them correctly/at all. LOGGER.error("Failed to take screenshot - out of memory", outOfMemoryError); } } return null; }