Package jp.vmi.selenium.selenese.command

Examples of jp.vmi.selenium.selenese.command.ICommand


     * @param name command name.
     * @param args command arguments.
     */
    public void addCommand(ICommandFactory commandFactory, String name, String... args) {
        int i = commandList.size() + 1;
        ICommand command = commandFactory.newCommand(i, name, args);
        addCommand(command);
    }
View Full Code Here


     */
    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        Object[] args = invocation.getArguments();
        Context context = (Context) args[CONTEXT];
        ICommand command = (ICommand) args[COMMAND];
        String[] curArgs = (String[]) args[CUR_ARGS];
        if (context instanceof HighlightHandler) {
            HighlightHandler handler = (HighlightHandler) context;
            handler.unhighlight();
            if (handler.isHighlight()) {
                int i = 0;
                String[] locators = command.convertLocators(curArgs);
                for (String locator : locators)
                    handler.highlight(locator, HighlightStyle.ELEMENT_STYLES[i++]);
            }
        }
        return invocation.proceed();
View Full Code Here

     */
    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        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

    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        LogIndentLevelHolder holder = (LogIndentLevelHolder) invocation.getThis();
        Object[] args = invocation.getArguments();
        Context context = (Context) args[CONTEXT];
        ICommand command = (ICommand) args[COMMAND];
        LogRecorder clr = context.getCurrentTestCase().getLogRecorder();
        String indent = StringUtils.repeat("  ", holder.getLogIndentLevel());
        String cmdStr = command.toString();
        log.info(indent + cmdStr);
        clr.info(indent + cmdStr);
        try {
            Result result = (Result) invocation.proceed();
            logResult(clr, indent, cmdStr, result, context);
View Full Code Here

        for (Object o : commands) {
            Map<String, String> c = JSMap.toMap(engine, o);
            String name = c.get("command");
            String target = StringUtils.defaultString(c.get("target"));
            String value = StringUtils.defaultString(c.get("value"));
            ICommand command = factory.newCommand(++index, name, target, value);
            commandList.add(command);
        }
        return commandList;
    }
View Full Code Here

TOP

Related Classes of jp.vmi.selenium.selenese.command.ICommand

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.