protected Result executeImpl(Context context, String... curArgs) {
if (!(context instanceof ScreenshotHandler))
return new Success("captureEntirePageScreenshot is not supported.");
String filename = curArgs[ARG_FILENAME];
if (StringUtils.isBlank(filename))
return new Warning("captureEntirePageScreenshot is ignored: empty filename.");
ScreenshotHandler handler = (ScreenshotHandler) context;
if (handler.isIgnoredScreenshotCommand())
return new Success("captureEntirePageScreenshot is ignored.");
try {
addScreenshot(handler.takeScreenshot(filename), "cmd");
return SUCCESS;
} catch (UnsupportedOperationException e) {
return new Warning(e.getMessage());
}
}