{{announcement.body}}
{{announcement.title}}
Refcard #239

Getting Started With Appium

Mobile App Automation Made Awesome

In this Refcard, you will learn everything you need to know about getting started with this open-source tool, from installing the Appium server to running your first tests. Download this Refcard now to see why Appium is "Mobile App Automation Made Awesome."

Published: Jul. 01, 2020
7,641
Free PDF for easy Reference

Brought to you by

Sauce Labs
refcard cover

Written by

author avatar Wim Selles Sr. Solutions Architect, Sauce Labs
author avatar Dave Haeffner Author, Elemental Selenium
asset cover
Refcard #239

Getting Started With Appium

Mobile App Automation Made Awesome

In this Refcard, you will learn everything you need to know about getting started with this open-source tool, from installing the Appium server to running your first tests. Download this Refcard now to see why Appium is "Mobile App Automation Made Awesome."

Published: Jul. 01, 2020
7,641
Free PDF for easy Reference

Written by

author avatar Wim Selles Sr. Solutions Architect, Sauce Labs
author avatar Dave Haeffner Author, Elemental Selenium

Brought to you by

Sauce Labs
Table of Contents

What is Appium?

Interrogating Your App

Commands and Operations

Appium Service Providers

Section 1

What is Appium?

Appium is a free and open-source mobile automation framework used for native, hybrid, and mobile web apps. It works on iOS, Android, Mac, and Windows apps using the WebDriver protocol. WebDriver (the API to automate browsers, maintained by the Selenium project) is currently going through a W3C (World Wide Web Consortium) specification.


This is a preview of the Getting Started With Appium Refcard. To read the entire Refcard, please download the PDF from the link above.

Getting Started

In order to get up and running on your local machine, you need to download an Appium server and client bindings for your preferred programming language. There are Appium language bindings for multiple programming languages. The officially supported ones (in alphabetical order) are:

  • C# (.NET)
  • Java
  • JavaScript (Node.js)
  • Objective C
  • PHP
  • Python
  • Robot Framework
  • Ruby

Before we dive into installing all of the Appium dependencies, we are first going to look into the iOS and Android dependencies.


This is a preview of the Getting Started With Appium Refcard. To read the entire Refcard, please download the PDF from the link above.

Section 2

Interrogating Your App

Writing automated scripts to drive an app in Appium is very similar to how it's done in Selenium. You first need to choose a locator strategy. A locator is how you want to find an element. Then, you have the selector, which finds an element based on the provided search criteria.

Below, you will find a table with all available locator strategies for Selenium/Appium:

Locator strategy

From

Support in Appium

class name

Selenium

Yes

id

Selenium

Yes

name

Selenium

Yes

xpath

Selenium

Yes

accessibility id

Appium

Yes

-ios predicate string

Appium

Yes

-ios class chain

Appium

Yes

-android uiautomator

Appium

Yes

-ios uiautomation

Appium

Deprecated

css selector

Selenium

No/Yes*

link text

Selenium

No/Yes*

partial link text

Selenium

No/Yes*

tag name

Selenium

No/Yes*


This is a preview of the Getting Started With Appium Refcard. To read the entire Refcard, please download the PDF from the link above.

Section 3

Commands and Operations

The most common operations you'll end up doing in Appium are finding an element (or a set of elements) and performing actions with those elements (e.g. tap, type text, swipe, etc.). You can also ask questions about the elements (e.g. Is it displayed? Is it enabled? etc.), pull information out of the element (e.g. the text of an element or the text of a specific attribute within an element), or perform additional gestures.

Finding an Element

Java
 




xxxxxxxxxx
1


 
1
// The $ is a shorthand for browser. findElement('locator', 'selector') 
2
// Find 1 element const element = $('locator'); 
3

          
4
// The $$ is a shorthand for browser. findElements('locator', 'selector') 
5
// Find multiple elements with the same locator const elements = $$('locator');


Work With a Found Element

Java
 




xxxxxxxxxx
1


 
1
// Chain actions together $('locator').click(); 
2
// Store the element and then click it const element = $('locator'); element.click();



This is a preview of the Getting Started With Appium Refcard. To read the entire Refcard, please download the PDF from the link above.

Section 4

Appium Service Providers

Appium Service Providers Rather than take on the overhead of standing up and maintaining a test infrastructure, you can easily outsource these services to a third-party cloud provider like Sauce Labs. With Sauce Labs, you'll be able to get access to real devices as well as simulators and emulators.

Note: You'll need an account to use Sauce Labs. Their free trial offers enough to get you started. And if you're signing up because you want to test an open-source project, then be sure to check out their Open Sauce account.


This is a preview of the Getting Started With Appium Refcard. To read the entire Refcard, please download the PDF from the link above.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}