javaseleniumappiumsaucelabsdesiredcapabilities

Appium Sauce Labs - Unsupported OS/browser/version/device combo


I am trying to setup my first Appium test (not a native or hybrid app) in Sauce Labs and I'm getting a WebDriverException when trying to setup my capabilities:

org.openqa.selenium.WebDriverException: Unable to parse remote response: Misconfigured -- Unsupported OS/browser/version/device combo: OS: 'unspecified', Browser: 'iphone', Version: '11.2.2.', Device: 'iPhone Simulator'`

Here is what I am doing to setup my caps:

public static DesiredCapabilities CreateAppiumCapabilities(String browser, String version, String platform,String device, String methodName) { 
DesiredCapabilities caps = new DesiredCapabilities(); 
caps.setCapability(MobileCapabilityType.PLATFORM_NAME, platform); 
caps.setCapability(MobileCapabilityType.PLATFORM_VERSION, version); 
caps.setCapability(MobileCapabilityType.DEVICE_NAME, device); 
caps.setCapability(MobileCapabilityType.AUTOMATION_NAME,"XCUITest"); 
caps.setCapability(MobileCapabilityType.BROWSER_NAME, browser); 
caps.setCapability("appiumVersoin", "1.7.2"); 
caps.setCapability("name", methodName); 
System.out.println(caps); 
return caps;

Then, in my testBase.java file I run this:

private ThreadLocal<IOSDriver> iosDriver = new ThreadLocal<IOSDriver>();

...
...
...

DesiredCapabilities capabilities = SauceUtils.CreateAppiumCapabilities(browser, version, platform, device, methodName);
                String url = SauceUtils.getURL();
                iosDriver.set(new IOSDriver(new URL(url), capabilities));
                sessionId.set(((IOSDriver) getIosDriver()).getSessionId().toString());

The System.out.println(caps) shows everything correctly:

Capabilities {appiumVersoin: 1.7.2, automationName: XCUITest, browserName: Safari, deviceName: iPhone Simulator, name: appiumTest, platformName: iOS, platformVersion: 11.2.2}

Here's the actual test:

public class AppiumTest extends TestBase {
    @Test(dataProvider = "appium", groups = "Appium", description = "simple appium test")
    public void appiumTest(String browser, String version, String platform, String device, Method method) throws Exception {
        this.createDriver(browser, version, null, method.getName(), device, platform);
        IOSDriver<WebElement> mobiledriver = getIosDriver();
        mobiledriver.get("http://appium.io/");
        Assert.assertEquals(mobiledriver.getCurrentUrl(), "http://appium.io/", "URL Mismatch");
        Assert.assertEquals(mobiledriver.getTitle(), "Appium: Mobile App Automation Made Awesome.", "Title Mismatch");
    }
}

And the getIosDriver() function:

    public IOSDriver<WebElement> getIosDriver() {
        return iosDriver.get();
    }

Not sure what I am doing wrong here, any and all help would be greatly appreciated! :)


Solution

  • It appears from the pasted code above that there is a typo in "appiumVersion" capability:

    caps.setCapability("appiumVersoin", "1.7.2"); 
    

    should be

    caps.setCapability("appiumVersion", "1.7.2");