DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Refcards
  3. Getting Started With Appium
refcard 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."

Free PDF for Easy Reference
refcard cover

Written By

author avatar Wim Selles
Staff Product Manager Mobile, Sauce Labs
author avatar Dave Haeffner
Author, Elemental Selenium
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.

Like This Refcard? Read More From DZone

related article thumbnail

DZone Article

related refcard thumbnail

Free DZone Refcard

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

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

{{ parent.tldr }}

{{ parent.linkDescription }}

{{ parent.urlSource.name }}
by
CORE
· {{ parent.articleDate | date:'MMM. dd, yyyy' }} {{ parent.linkDate | date:'MMM. dd, yyyy' }}
Tweet
{{ parent.views }} ViewsClicks
  • Edit
  • Delete
  • {{ parent.isLocked ? 'Enable' : 'Disable' }} comments
  • {{ parent.isLimited ? 'Remove comment limits' : 'Enable moderated comments' }}