Presentation and example of testing a hybrid mobile app with Appium
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

class: title

Testing hybrid mobile apps with Appium

Ben Godfrey

What is Appium?

  • Selenium for phones and tablets
  • Speaks the WebDriver protocol
  • iOS and Android
  • Test native or hybrid apps

Appium interactions

  • Tap
  • Fill in forms (type text, selects, radios, checkboxes)
  • Gestures
  • Multitouch

A simple app

Use Ionic to create a basic app.

npm install —g cordova ionic
ionic start foo tabs
cd foo
ionic platform add ios
ionic build ios
ionic emulate ios

(Use npm run createapp in the git repo.)

A simple test

// capabilities for iOS simulator
var capabilities = {
  browserName: "",
  autoWebview: true,
  platformName: "iOS",
  platformVersion: "7.1",
  deviceName: "iPhone Simulator",
  app: "/path/to/"

A simple test

// setup wd session
before(function(done) {
  browser = wd.promiseChainRemote(appiumServer);
    .then(function() { done(); });

A simple test

// test a very simple property of the app
it("should have title 'Dashboard'", function (done) {
    .then(function() { done(); });

A simple test

// kill session after tests have run
after(function(done) {
    .then(function() { done(); });

A more exciting test

// a more exciting test
it("should have some tabs", function (done) {
    .then(function() { done(); });

Run tests

git clone
cd testing-hybrid-apps-with-appium
npm install
appium & # or run in separate console
npm test

Real devices


  • No problems!


Test clouds

Provider Note
TestDroid Lots of real devices
Saucelabs Emulators
Appthwack Some real devices, had issues

How should I organise my Appium tests?

  • JavaScript is not the only choice
  • Jasmine, Mocha, Cucumber
  • Page objects


You should follow @wongatech.