Appium Tutorial for Beginners

Mobile Testing Published on:
What is Appium

So what is Appium? Here is a quick Appium tutorial for beginners. I recently interviewed James Koch from Quilmont about Appium for beginners. Between that interview and an earlier interview with the creator's of Appium, Dan Cuellar and Jonathan Lipps, one can get a pretty decent overview of what Appium is all about, as well as find out how it works.

Here is what I discovered.

What is Appium?

Appium is a free, open-source, cross-platform mobile UI automation framework. It allows you to write UI tests for your mobile apps, for Android iOS, and some other OSs. It also lets you write it using the Selenium JSON writer you know and love from web automation.

How Appium Works

A great way to think about Appium is that it's simply a server that runs, and listens to your HTTP requests just like any other server.

All the language bindings (like C#, Python, Ruby, etc.) do is send web requests to a server, and because Appium uses the same protocol as Selenium it is able to translate.

Dan said this is possible because they were able to re-purpose and lots of existing Selenium code, which in turn allows Appium to use all the Selenium language bindings.

And since Appium talks the same protocol over HTTP, the Selenium bindings can just talk to Appium, and Appium can talk back.

That's how it works with all of them — with very little effort.

Appium Itself is a Javascript App

Appium is a Javascript app that runs in NodeJs; it sits there and just listens for whatever requests it might receive. And then, we already have the Selenium clients who can send in those kinds of web requests, and Appium simply hooks them in.

So at its heart, it's a web server that exposes a Rest API and uses JSON protocol to communicate between your script, the Appium server, and real or virtual devices.


Appium iOS

Appium works on iOS by interacting with the UIAutomation Library. Appium 1.5 also includes an iOS implementation, which does not use UI automation Javascript but rather the new Swift XC UI tests library. So you are future proof going forward and Appium, Appium will continue to work with versions of Xcode that continue to support UI automation Javascript.

Appium Android

The Appium android support works by using the UIAutomator framework for newer platforms and Selendroid for older Android platforms.

Appium Tutorial JSONAppium Tutorial JSON

What is Json Wire Protocol?

The JSON wire protocol is a transport mechanism that was created by the Selenium webdriver folks. You can interact with it using a REST API. Appium implements the mobile JSON wire protocol, which allows it to control different mobile devices and behaviors over a session. 

Jason has a cool analogy to explain the JSON wire protocol. You can think of JSON as the telephone power lines that transmit your information. They're mainly categorized by the verbiage they use like do, get, or post methods, but Appium manages its runs through sessions, and we think of JSON as the infrastructure your code travels down in those sessions.

You can think of a session as a run. Each time the server's started and a new test case is run, a new session begins. After your test works through your test and flow for your instance, it tears down Appium, your session is finished. 

Why Choose Appium for Your Mobile Testing?

First, since Appium is a subset of the Selenium WebDriver JSON wire Protocol, if you are already familiar with Selenium, Appium should be easy enough for you to pick up. For example, you find elements by using a subset of the WebDriver's element-finding strategies.

Second, Appium is becoming an industry standard for mobile testing, much as Selenium WebDriver become the industry standard for browser-based automation a few years ago.

Dan points to Appium really gaining momentum a year or so ago when Appium passed over Robotium and then Calabash to become the tool that most automation engineers were gravitating towards for their mobile testing efforts.

Also, many large companies like Amazon, Zameron, Perfecto Mobile and others decided to put Appium into their clouds, which was a huge win for Appium adoption.

When you see big companies like Microsoft actually working on getting Appium support built into their mobile operating system I definitely think you’ll agree that it appears that we've hit that point where Appium really is become the defacto standard for mobile test automation.

James agrees and is seeing more and more companies use Appium to automate their tests. Unlike test frameworks such as Calabash, there's no real need to recompile or add any third party framework to your app just to test it. That means you're testing the same app you're shipping, and you're able to execute tests on a real production build.

What You Need to Know to Get Started with Appium 

It's important to understand Selenium driver protocol, and really nail down which programming language you want to use. Of course, the best course of action is to just download Appium from github and get started. 

Expert Actionable Appium Advice

At the end of every TestTalks episode, I ask for one piece of actionable advice for my listeners.
Dan Cuellar Headshot

Dan Cuellar recommended reading the release notes because they’re always tweaking stuff to make it better. A lot of the time, that knowledge doesn't get out any other way. They do release almost every two weeks. So read the release notes — there's good stuff in there. It will also prevent the hundreds of bogus bugs logged in the Appium repository.

James Koch headshot

James Koch also mentioned that when he was starting out, there wasn’t any solid, centralized information to follow along with to get started with Appium. Since then, however, more and more people have written about it, and a good number of processes have been developed. He recommends that you take notes on what everyone else is doing, gains an understanding of those processes, and organize that knowledge to adapt it to your own structure. As James would say, if you're brand new to Appium, hit the ground running and just start learning it.

Jonathan Lipps HeadShot

Jonathan Lipps‘s the main man behind all the latest Appium innovations actionable advice that he recommends is to check out the new docs section because they've been completely redesigned and reorganized and updated.  So things are so much better than they were. You'll find essentially an API reference for Appium which is something that they've never had. So every command that Appium supports it has which client libraries it's available in which drivers it's supported by code examples and all the rest and we've put a lot of work into this. So if you've gone to the Appium site before and been disappointed with the docs like I've been for a number of years go check it out again today —

3 responses to “Appium Tutorial for Beginners”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

What is Appium