Skip to end of metadata
Go to start of metadata

You can also clone this script directly from GitHub.

Authentication over HTTP instead of HTTPS

Unlike other languages, the Selenium bindings for Python don't support connecting over HTTPS. In the code example, you can see that connection to Sauce Labs is over HTTP, while the code examples for other languages are over HTTPS. This issue is documented, along with a proposed fix, in the Selenium issue tracker: https://github.com/SeleniumHQ/selenium/issues/420

from appium import webdriver

desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['appiumVersion'] = '1.4.16'
desired_caps['platformVersion'] = '4.2'
desired_caps['deviceName'] = 'Android Emulator'
desired_caps['browserName'] = ''
desired_caps['name'] = 'Sample Test'
desired_caps['app'] = 'http://appium.s3.amazonaws.com/ContactManager.apk'

driver = webdriver.Remote('http://YOUR_SAUCE_USERNAME:YOUR_ACCESS_KEY@ondemand.saucelabs.com:80/wd/hub', desired_caps)

# Test Actions here...

driver.quit()