Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-29047

Wrong value for iOS 'browser' environment variable when using Appium

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • sauce-ondemand-plugin
    • None
    • sauce-ondemand-plugin 1.129

      When selecting a platform with Appium the 'browser' environment variable gives the wrong value. This causes the test to not be able to start in Sauce Labs.

      For example: when selecting "Appium + iPhone 8.0 (portrait)", these are the values that I get for the environment variables set by the plugin:

      platform: 'iOS'
      version: '8.0'
      browser: 'iphone'
      device: 'iPhone Simulator'
      deviceType: None
      

      The platforms configurator in Sauce Labs indicates that these should be the desired capabilities that I should be using for "Appium + iPhone 8.0 (portrait)":

      caps['browserName'] = "Safari"
      caps['appiumVersion'] = "1.4.3"
      caps['deviceName'] = "iPhone Simulator"
      caps['deviceOrientation'] = "portrait"
      caps['platformVersion'] = "8.0"
      caps['platformName'] = "iOS"
      

      As you can see when using Appium the 'browser' should be 'Safari' instead of 'iphone'. Thus this is how I have to set my desired capabilities to make things work:

             desired_capabilities = {}
             desired_capabilities['platformName'] = os.environ.get('SELENIUM_PLATFORM')
             desired_capabilities['platformVersion'] = os.environ.get('SELENIUM_VERSION')
             desired_capabilities['deviceName'] = os.environ.get('SELENIUM_DEVICE')
             desired_capabilities['browserName'] = 'Safari' 
             desired_capabilities['appium-version'] = '1.4.3' 
      

      You can see my code here: https://github.com/albedithdiaz/JenkinsTests/blob/master/iOS_SaucePlugin.py

            rossrowe Ross Rowe
            albedith albedith diaz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: