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