Search in sources :

Example 1 with NavigateBackAction

use of com.testsigma.automator.actions.common.NavigateBackAction in project testsigma by testsigmahq.

the class ClickOnButtonInTheBrowserProxyAction method execute.

@Override
public void execute() throws Exception {
    String button = getTestData();
    switch(button) {
        case ActionConstants.REFRESH:
            ReLoadCurrentPageAction refresh = (ReLoadCurrentPageAction) this.initializeChildSnippet(ReLoadCurrentPageAction.class);
            refresh.execute();
            this.setSuccessMessage(refresh.getSuccessMessage());
            break;
        case ActionConstants.BACK:
            NavigateBackAction back = (NavigateBackAction) this.initializeChildSnippet(NavigateBackAction.class);
            back.execute();
            this.setSuccessMessage(back.getSuccessMessage());
            break;
        case ActionConstants.FORWARD:
            NavigateForwardAction forward = (NavigateForwardAction) this.initializeChildSnippet(NavigateForwardAction.class);
            forward.execute();
            this.setSuccessMessage(forward.getSuccessMessage());
            break;
        default:
            setErrorMessage("Unable to Click on Button in the Browser due to error at test data");
            throw new AutomatorException("Unable to Click on Button in the Browser due to error at test data");
    }
}
Also used : AutomatorException(com.testsigma.automator.exceptions.AutomatorException) NavigateBackAction(com.testsigma.automator.actions.common.NavigateBackAction) NavigateForwardAction(com.testsigma.automator.actions.common.NavigateForwardAction)

Aggregations

NavigateBackAction (com.testsigma.automator.actions.common.NavigateBackAction)1 NavigateForwardAction (com.testsigma.automator.actions.common.NavigateForwardAction)1 AutomatorException (com.testsigma.automator.exceptions.AutomatorException)1