use of com.testsigma.agent.exception.MobileAutomationServerSessionException in project testsigma by testsigmahq.
the class IosMobileAutomationServer method createSession.
public void createSession(String uniqueId) throws MobileAutomationServerSessionException {
try {
MobileDevice device = deviceContainer.getDevice(uniqueId);
log.info("Creating IosDriver Session on device - " + device.getUniqueId());
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, MobileOs.IOS.getPlatformName());
desiredCapabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, device.getOsVersion());
desiredCapabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, MobileOs.IOS.getAutomationName());
desiredCapabilities.setCapability(MobileCapabilityType.DEVICE_NAME, device.getName());
desiredCapabilities.setCapability(MobileCapabilityType.UDID, device.getUniqueId());
desiredCapabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 3600);
desiredCapabilities.setCapability("xcodeOrgId", "6F4CKCA4LX");
desiredCapabilities.setCapability("xcodeSigningId", "iPhone Developer");
desiredCapabilities.setCapability("app", "/Users/vikram/ios-apps/ios-test-app/build/Release-iphoneos/TestApp-iphoneos.app");
device.setRemoteWebDriver(new IOSDriver<>(new URL(mobileAutomationServerService.getMobileAutomationServer().getServerURL()), desiredCapabilities));
} catch (Exception e) {
throw new MobileAutomationServerSessionException(e.getMessage());
}
}
Aggregations