Package jp.vmi.selenium.selenese

Examples of jp.vmi.selenium.selenese.ScreenshotHandler


        Object[] args = invocation.getArguments();
        Context context = (Context) args[CONTEXT];
        ICommand command = (ICommand) args[COMMAND];
        Result result = (Result) invocation.proceed();
        if (context instanceof ScreenshotHandler && command.mayUpdateScreen()) {
            ScreenshotHandler handler = (ScreenshotHandler) context;
            String baseName = context.getCurrentTestCase().getBaseName();
            try {
                command.addScreenshot(handler.takeScreenshotAll(baseName, command.getIndex()), "all");
                if (!result.isSuccess())
                    command.addScreenshot(handler.takeScreenshotOnFail(baseName, command.getIndex()), "fail");
            } catch (WebDriverException e) {
                // ignore if failed to capturing.
            }
        }
        return result;
View Full Code Here


        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());
        }
    }
View Full Code Here

TOP

Related Classes of jp.vmi.selenium.selenese.ScreenshotHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.