Appium Installation Guide
Appium Installation Guide
Table of Contents
Chapter 1: Introduction....................................................................................................3
Purpose..................................................................................................................................................... 3
Download Java......................................................................................................................................... 4
Download Android Studio and Android SDK......................................................................................... 7
Download Node........................................................................................................................................ 7
Set Windows system variables............................................................................................................... 8
Android Studio and Configure Emulator.............................................................................................. 20
Install and start the Appium Server via Node......................................................................................26
Download APK demo app...................................................................................................................... 27
Install Eclipse Editor.............................................................................................................................. 27
1
Setup Maven Project with Appium Dependencies..............................................................................28
Understanding the Desired Capabilities to setup the Environment in the Appium..........................28
Appium first program to invoke the Android Apps.............................................................................29
2
Chapter 1: Introduction
Purpose
The document will help end user to understand process of Appium installation and configuration on
Windows operating system
3
Download Java
Using browser Google for JDK download and download JDK 11.x for windows
https://www.oracle.com/java/technologies/downloads/#java11-windows
Once installer is downloaded then simply double click on it and follow the installation steps
Step 1 : Navigate to folder where user install Java JDK from windows explorer and copy the folder
path
Step 2 : Go to Control Panel\All Control Panel Items\System and click on “Advanced System
settings”
4
Step 4: Environment Variable windows click on “New” of System variables
5
Step 5: Enter “Variable Name:” as “JAVA_HOME” and “Variable value:” as name of java folder
which you copied by executing Step 1
6
Click on “OK” button of System Properties window
To work with Appium user will need Android SDK app and to install user needs to download
Android Studio.
Step 1: Google for “download android studio for windows” and install android studio with standard
mode.
Step 2 : Once Android studio is installed then install Android SDK by double clicking - C:\Program
Files\Android\Android Studio\bin\studio64.exe
Download Node
To run Appium test cases user needs to start Appium server and it is developed in Node.JS. All the
test cases to divert to Appium server and this server will invoke application on mobile.
Google “download node js for windows” and download .msi for Windows 64 bit.
Download - https://nodejs.org/en/download/
7
Once you download .msi file, double click on it and follow installation steps. This will install below
packages:
Pre-requisite user needs to enabled Android SDK Platform-Tools from Android Studio
Step 1 : Launch Android Studio application. If user opening Android studio 1 st time, then just follow
the instructions and create default android project. Project screen will look like below
8
Step 4 : From left pane select Appearance & Behavior => System Settings => Android SDK.
Select “Show Package Details” option button – this will display packages
Step 2: Go to Control Panel\All Control Panel Items\System and click on “Advanced System
settings”
9
Step 2: System Properties windows – Click on “Environment Variables”
10
Step 4: Enter “Variable Name:” as “ADROID_HOME” and “Variable value:” as name of java folder
which you copied by executing Step 1
11
Click on “OK” button of System Properties window
Step 2: Go to Control Panel\All Control Panel Items\System and click on “Advanced System
settings”
12
Step 3: Environment Variable windows select “Path” from “System variables” section and click on
“Edit” of System variables
13
Step 4:Click on “New” button, this will add one blank rows at bottom in existing list of environment
variable
14
Step 5 : Copy the C:\Users\<Username>\AppData\Local\Android\Sdk\tools\bin
15
Step 6: Repeat the Step 1 to Step 5 to below paths:
C:\Users\ssughade\AppData\Local\Android\Sdk\tools
C:\Users\ssughade\AppData\Local\Android\Sdk\platform-tools
Step 2: Go to Control Panel\All Control Panel Items\System and click on “Advanced System
settings”
16
Step 3: Environment Variable windows click on “New” of System variables
17
Step 4: Enter “Variable Name:” as “NODE_HOME” and “Variable value:” as name of folder which
you copied by executing Step 1
Step 2: Go to Control Panel\All Control Panel Items\System and click on “Advanced System
settings”
19
Step 3: Environment Variable windows select “Path” from “System variables” section and click on
“Edit” of System variables
20
Step 4:Click on “New” button, this will add one blank rows at bottom in existing list of environment
variable
Step 1 : Launch Android Studio application. If user opening Android studio 1 st time, then just follow
the instructions and create default android project. Project screen will look like below
21
Step 2 : Go to Tool => AVD Manager menu
Select “Nesus 5” from list (User can select any desire device)
Click on “Next”
22
23
Select which Android version user wish to use. If the version is not install then user can click
“Download” button and download available latest android version
Select “Nougat”
24
Enter “AVD Name” as “Demo_AVD”
Click on “Finish”
Newly created AVD will get save and it will be available in list
25
Check the Virtual device will appears on your screen
26
Starting AVD from command line
cd C:\Users\ssughade\AppData\Local\Android\Sdk\platform-tools
Step 1: Launch cmd using Administration mode. Go to “Start”, type cmd and Click on “Run as
administrator”
28
Download APK demo app
https://github.com/appium/appium/blob/master/sample-code/apps/ApiDemos-debug.apk
download it
User should install this APK on Android Virtual Device by executing below steps :
Step 2: Create “Run.bat” file in the same folder, write “cmd” word in this file and save it
Step 3: Double click on “Run.bat” file – This will open command prompt
Step 4: Type command and press enter key: adb install <apk_file>
Google search for “download eclipse ide for java developers for windows”.
Note - Download Eclipse IDE for Java Developers which has essential tool – Maven
URL : https://www.eclipse.org/downloads/packages/release/juno/sr2/eclipse-ide-java-developers
Download it.
29
Write first java program which will print “Hello” word
<dependencies>
<!-- https://mvnrepository.com/artifact/io.appium/java-client -->
<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>7.5.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-
java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
</dependencies>
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.remote.DesiredCapabilities;
30
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(MobileCapabilityType.DEVICE_NAME, "Sid_Nexus_5X");
cap.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
cap.setCapability(MobileCapabilityType.AUTOMATION_NAME,
"uiautomator2");
The following diagram is an overview of how the components of POM interact with the components
of products such as.
31