Search in sources :

Example 1 with SwitchToContextWithNameAction

use of com.testsigma.automator.actions.mobile.android.switchactions.SwitchToContextWithNameAction in project testsigma by testsigmahq.

the class DriverSessionCommand method switchToContextByName.

private void switchToContextByName(RemoteWebDriver remoteWebDriver, MobileElement mobileElement) throws Exception {
    SwitchToContextWithNameAction switchToContext = new SwitchToContextWithNameAction();
    switchToContext.setTestDataPropertiesEntityMap(createTestDataPropertiesMap(mobileElement.getWebViewName()));
    switchToContext.setDriver(remoteWebDriver);
    ActionResult result = switchToContext.run();
    if (ActionResult.FAILED.equals(result)) {
        log.error(switchToContext.getErrorMessage());
        throw new Exception("Failed to Switch to context " + " : " + switchToContext.getErrorMessage());
    }
}
Also used : ActionResult(com.testsigma.automator.constants.ActionResult) SwitchToContextWithNameAction(com.testsigma.automator.actions.mobile.android.switchactions.SwitchToContextWithNameAction) MobileAutomationServerCommandExecutionException(com.testsigma.agent.exception.MobileAutomationServerCommandExecutionException)

Aggregations

MobileAutomationServerCommandExecutionException (com.testsigma.agent.exception.MobileAutomationServerCommandExecutionException)1 SwitchToContextWithNameAction (com.testsigma.automator.actions.mobile.android.switchactions.SwitchToContextWithNameAction)1 ActionResult (com.testsigma.automator.constants.ActionResult)1