All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.siwenyan.si.SiCommandExecutorSelectWindow Maven / Gradle / Ivy

There is a newer version: 1.25.1.0
Show newest version
package com.github.siwenyan.si;

class SiCommandExecutorSelectWindow extends SiCommandExecutor implements ISiCommandExecutorFlagUi {

    @Override
    public void execute(SiCommand command, SiContext siContext) throws SiVerifyException, SiWebDriverException {

        String target = command.getSiModelCommand().getTarget();
        String[] p = target.split("\\s*=\\s*", 2);
        if(!"handle".equals(p[0])){
            throw new SiVerifyException("Unknown select type: "+p[0]);
        }
        target = siContext.dynamic(p[1], "", "");

        siContext.asWebDriver().switchTo().window(target);

    }

    @Override
    public void beforeExecute(SiCommand command, SiContext siContext) throws SiVerifyException, SiWebDriverException {
        super.beforeExecute(command, siContext);
        siContext.clearAlert();
    }

    @Override
    public void afterExecute(SiCommand command, SiContext siContext) throws SiVerifyException, SiWebDriverException {
        siContext.clearAlert();
        super.afterExecute(command, siContext);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy