Announcing iOS and Android App Testing on Sauce

appiumonsauceToday we are very excited to announce the general availability of Appium on Sauce! Appium is the open source cross-platform mobile automation platform for native mobile, hybrid, and mobile web apps, and it runs on iOS (iPhone and iPad) and Android devices and emulators. Appium represents a huge step forward in the fight to make mobile automation a first-class citizen in mobile development. We've been running our iOS-based private beta for Appium on Sauce for a while, and have made many improvements while supporting the development of the Appium open source community. Since then, Android support has matured to the point where we are now offering it in our cloud alongside iPhone and iPad. Soon enough, we'll be releasing the ability to run your Appium tests not only on our cloud of emulators and simulators, but also on real devices (stay tuned for more on that later!). If you want to get started with Appium right now, simply visit the Appium on Sauce tutorial. And check out the Appium iPhone demo below.

If you're interested in what Appium's all about, read on. After contributing thousands of lines of code to the open-source project and helping to breathe fire into what has become a very active community (see our issue tracker, our discussion group, or join us in #appium on freenode), it's clear to us that Appium's philosophy is compelling to a wide array of developers, test engineers, and QA professionals. Appium's philosophy can be stated pretty succinctly in the form of four principles:

    1. Test the same app you submit to the marketplace. (You shouldn't have to recompile your app with a 3rd-party library to test it.)
    2. Write your tests in any language, using any framework. (You shouldn't have to learn a new language.)
    3. Use a standard automation specification and API. (Don't re-invent the automation model wheel.)
    4. Build a large and thriving open-source community effort. (Say no to vendorware and skunkworks.)

Based on the huge amount of energy we've been receiving from the growth of the open source community, I'd say these principles are withstanding scrutiny. While Appium on its own is a leap forward in mobile automation, allowing true cross-platform testing and scaling across the different dimensions of apps and devices (simulator vs. real devices, iOS vs. Android, native vs. hybrid), it is especially powerful when combined with Sauce Labs. Sauce's value has historically been most apparent in freeing web developers and testers from managing their own test and reporting infrastructure. With Appium, this instant scalability is available to mobile-focused teams as well. Only on Sauce can you run your mobile tests across platforms in massive parallel, opening up a world of potential for continuous integration and QA in general. Continuous deployment for mobile apps, anyone? It's possible, and with Appium on Sauce it can become the standard. If you've done Selenium testing, writing Appium tests is as easy as writing the Selenium WebDriver tests you may be familiar with or may be already running on Sauce. You can write them in any language (Python, Java, PHP, Ruby, Node.js, C#, Go, Haskell, etc...) or test framework (RSpec, PHPUnit, JUnit, Nose, Mocha, Vows, Cucumber, Capybara, etc...). And of course, they come with the same great reporting (screenshots, videos, and command logs) as browser-based test sessions. I'll leave you with an example test, running a notes application on Android (taken from this example):

import os
from selenium import webdriver

desired_caps = {}
desired_caps['device'] = 'Android'
desired_caps['browserName'] = ''
desired_caps['version'] = '4.2'
desired_caps['app'] = 'http://appium.s3.amazonaws.com/NotesList.apk'
desired_caps['app-package'] = 'com.example.android.notepad'
desired_caps['app-activity'] = 'NotesList'

SAUCE_USERNAME = os.environ.get('SAUCE_USERNAME')
SAUCE_ACCESS_KEY = os.environ.get('SAUCE_ACCESS_KEY')

driver = webdriver.Remote('http://%s:%s@ondemand.saucelabs.com:80/wd/hub' % (SAUCE_USERNAME, SAUCE_ACCESS_KEY), desired_caps)

el = driver.find_element_by_name("New note")
el.click()

el = driver.find_element_by_tag_name("textfield")
el.send_keys("This is a new note!")

el = driver.find_element_by_name("Save")
el.click()

els = driver.find_elements_by_tag_name("text")
assert els[2].text == "This is a new note!"
els[2].click()

driver.quit()

You can also take a look at an iPhone example test. Want to run Appium on Sauce right away? Simply create a Sauce account and you'll be good to go. If you're already a Sauce user or customer, you have access to Appium testing capability without any further steps. Once you're ready to start writing your Appium tests, take a look at the Appium on Sauce tutorial to get started. And don't forget to let us know how things are going for you in your quest to total mobile automation. Happy native app testing from all of us at Sauce!

Written by

Jonathan Lipps

Topics

App testingMobile testing