Search in sources :

Example 1 with SwitchToNativeAppContextAction

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

the class DriverSessionCommand method switchToNativeContext.

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

Aggregations

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