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());
}
}
Aggregations