Appium Java: By: Jorge Avila
Appium Java: By: Jorge Avila
● What is Appium?
● Appium Concepts
● Advantages / Disadvantages
● Architecture
● Setup Dev Environment
● Setup Project
● Demo
○ Creating a simple test with Native App
What is Appium?
Appium is a Mobile web, Native and Hybrid Software Application test automation tool
developed by Sauce Labs
it is an open source software automation tool which is useful to automate Android and iOS
platform apps
Appium Concepts
● Client/Server Architecture
○ Appium is at its heart a webserver that exposes a REST API
● Session
○ Automation is always performed in the context of a session. Clients initiate a session with a server
in ways specific to each library, but they all end up sending a POST /session request to the server,
with a JSON object called the 'desired capabilities' object
● Desired Capabilities
○ Desired capabilities are a set of keys and values (i.e., a map or hash) sent to the Appium server to
tell the server what kind of automation session we're interested in starting up
● Appium Server
○ Appium is a server written in Node.js. It can be built and installed from source or installed directly
from NPM
● Appium Client
○ There are client libraries (in Java, Ruby, Python, PHP, JavaScript, and C#) which support Appium's
extensions to the WebDriver protocol
● Appium Desktop
○ There is a GUI wrapper around the Appium server that can be downloaded for any platform
Appium Philosophy
1. You shouldn't have to recompile your app or modify it in any way in order to automate it.
2. You shouldn't be locked into a specific language or framework to write and run your tests.
3. A mobile automation framework shouldn't reinvent the wheel when it comes to
automation APIs.
4. A mobile automation framework should be open source, in spirit and practice as well as in
name!
Advantages
● Cross platform: Android & iOS: we can test Native, Hybrid and Web app
● Allows you to communicate with other apps, e.g. Whatsapp, (Majority of tools does not
support this)
● No pre-compilation of your app.
● Any WebDriver compatible language is supported: Java, Objective C, Ruby, PHP, C# we
just need language specific libraries to work on.
Disadvantages
Pre-requisites
● Install Java
● Eclipse / Intellij
● Maven plugin for Eclipse / Intellij
● TestNG plugin for Eclipse / Intellij
● Selenium r
● Nodejs
Android Tools
● Android Studio
● Appium Server/Appium Desktop
● Appium Client Library
Setup Environment
● Java
● Android Studio
● NodeJS
● Intellij IDEA
● Appium Server
For Maven, unzip the downloaded folder and copy it to “c:\apache-maven-3.6.1\” because this
tool does not have installer exe.
Setup Environment
Environment Variables: Set the HOME for each tool
Setup Environment
Environment Variables: Set the bin folder for each tool using the home folder
Setup Environment
Install SDK Tools for android:
Setup Environment
Setup Environment
Create an Android Virtual Device: Choose Device definition
Setup Environment
Create an Android Virtual Device: Choose System
Setup Environment
Create an Android Virtual Device: Verify Configuration
Setup IDE
Create a Maven Project in Intellij IDEA:
Finishing Environment Setup
Using a command line let’s install “appium-doctor”, this tool allow is inspect if everything what
we configured till this point is OK:
Finishing Environment Setup
Once the appium-doctor is installed, let’s execute the command “appium-doctor” in the
command line
Appium Desired Capabilities
Desired Capabilities are keys and values encoded in a JSON object, sent by Appium clients to
the server when a new automation session is requested. They tell the Appium drivers all kinds of
important things about how you want your test to work
http://appium.io/docs/en/writing-running-appium/caps/index.html
Starting to Automate