Search in sources :

Example 1 with MobileAutomationServerSessionException

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());
    }
}
Also used : MobileDevice(com.testsigma.agent.mobile.MobileDevice) MobileAutomationServerSessionException(com.testsigma.agent.exception.MobileAutomationServerSessionException) DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities) URL(java.net.URL) MobileAutomationServerSessionException(com.testsigma.agent.exception.MobileAutomationServerSessionException) TestsigmaException(com.testsigma.agent.exception.TestsigmaException)

Aggregations

MobileAutomationServerSessionException (com.testsigma.agent.exception.MobileAutomationServerSessionException)1 TestsigmaException (com.testsigma.agent.exception.TestsigmaException)1 MobileDevice (com.testsigma.agent.mobile.MobileDevice)1 URL (java.net.URL)1 DesiredCapabilities (org.openqa.selenium.remote.DesiredCapabilities)1