Reading Time: 5 mins

Overview

Appium, an unreservedly distributed and open-source automation tool for mobile applications, including; native applications, mobile-web applications and hybrid applications. It is the only automation tool that works for both iOS and Android operating systems and comes with cross-platform support. Further, it supports a wide range of programming languages such as PHP, Java, Ruby, Python, C#, etc. and holds the capability to handle both the real and virtual (Emulator/Simulator) devices. 

Appium’s Tenets:

  1. Testing a native app must not depend on the Software Development Kit (SDK) and thereby, need not undergo modification and recompilation. 
  2. Adaptability towards multiple testing frameworks, languages and tools.
  3. To be free to use and reach millions with its open-source nature. 

Why Choose Appium Over The Other Tools?

  • Unreservedly distributed and an open-source tool. 
  • It is the only mobile automation tool which underpins all kinds of mobile applications such as Native, Hybrid and Web Apps. 
  • It is the only automation tool that works for both iOs and Android. 
  • Being a Selenium family, it supports various programming languages as Selenium. 
  • Internally it uses the JSONWireProtocol to interact with the iOS and Android apps. 
  • It can handle real-devices and Emulator/Simulator. 

Installing Appium on Windows for Android Automation

Step 1: Fitting Java for Automation

First and foremost, it is necessary to download Java for your project. To download Java, go to the official website of Java or https://www.oracle.com/technetwork/java/javase/downloads/index.html

Step 2: Setting up the Java Environmental Variables

Adding the Java_home path into Environment Variables for a project lets you identify the location of Java. Go to, 

System Properties>>Advanced System Settings>>Environment Variables>>New System Variable

wherein enter the name and value (path) of the variable and tap OK.

adding-java-home-path-to-system-environment-variables=apium-installation

Similarly, add the JDK bin path by finding the path variable from the listed System Variables.

jdk-bin-path-to-system-variables-appium-installation

Double-clicking the path variable provides you with an option to add a new path to it. 

Step 3: To Download Android Studio

Next, it’s time to download the Android Studio on your system. Follow the link below to download it.

https://developer.android.com/studio

Note: Make sure that you find the Android Studio installation path on your system.

Don’t know how to find path?

Though downloading the Android Studio is all about giving a single tap, finding the installation path of it is not that easy as it sounds. By default, the folder called AppData will be in an invisible mode, henceforth, you need to find it by typing in the Directory Path tab. Go to, Local>>Android>>sdk.

Note: It is this sdk folder that contains the necessary folders to run an Android Emulator (a virtual device) using which you are going to test the mobile application. 

Step 4: Configuring System Variables for Android SDK and Java

Add Android sdk path (as Android_home) into your system’s Environment Variables similar to the java_home path. Open the sdk folder and go to, tools. Copy the location and add the above bin variable into the projects Environment Variable by finding the path variable from the list of System Variables (as you did for the JDK bin path).

Similarly, add the android>>sdk>>tools>bin and android>>sdk>>platform-tools location into your system’s Environment Variables. 

Step 5: Setting up the Android Studio

Now for setting up your Android Studio, go to Programme Files>>Android>>Android Studio>>bin>>studio64 (if it’s a 64 bit). Double-click the studio64 to get started with the studio. It may take a few seconds to start the application so just hold on.

Post which you’ll be asked whether to start a Sample Project or Import the Existing One. Click yes for  Sample Project and continue tapping  Next  until you get WorkSpace to start.

Step 6: Configuring the Virtual Device

To carry out the tests, you need to configure a virtual device or an emulator (if preferred, you can use a physical device too) and that’s where this Android Studio comes to the rescue. Now, in your Android studio, tap Tools and choose AVD Manager  (the AVD stands for Android Virtual Device). 

configuring-virtual-device-avd-manager-appium-installation

Now, you’ll be navigated to the AVD Manager page, wherein click Create Virtual Device.

avd-manager-creating-virtual-device-appium-installation

Choose the type of virtual device you wish to set and agree with Terms and Conditions to start the installation process.

selecting-virtual-device-type-appium-installation


Enter the name of your AVD in the Verify Configuration page (it’s recommended to leave the other settings as it is) and tap
Finish

verifying-configuration-avd-name-appium-installation

The Emulator is all set to go, tap the Play icon to start it. 

tapping-play-icon-to-start-emulator-appium-installation


At this time, you should see a virtual device like the one below. 

 

accessing-newly-created-emulator-appium-installation

Note: You can also start your virtual device using a command prompt and to do so, you should provide the path of your emulator by going to the sdk location.  

Step 7: To download Node.js and setting up the Environmental Variables

Now, you need to download the Node.js on your system, go to the official website or use the link, https://nodejs.org/en/download/

Next, you need to add the node.js path and npm (in-line command tool), node.js>>node_modules>>npm>>bin path into your system’s Environment Variables similarly as we did for Java and Android Studio in the previous steps. 

Step 8: Installing Appium Server via NPM (node module)

In order to execute the tests, you need to install the Appium Client Libraries (here, Java) and Appium Server separately. First, let’s start with the Appium Server installation. Open your command prompt and type,

npm -g appium

You may need to wait for a while as it takes a few minutes to download all the packages. 

Step 9: Configuring the Appium and Selenium Java client jars

To download Appium, go to http://appium.io/downloads.html

Since we’re looking for Java client jars, tap Java from the languages listed in the Appium Client Libraries.

adding-java-client-jars-from-appium-client-libraries

Post which you’ll be directed to the Maven page of Java client, wherein tap the Download icon. It is this downloaded jar which you may need to import into your project later. 

donwloading-java-client-jars-maven-page-appium-installation

Even though Selenium is meant for web automation (and not needed for mobile automation), it is highly recommended to install the Selenium Java client jars too. For the installation of Selenium Java client jars, https://www.eclipse.org/downloads/#

Choose the language-specific Selenium Client & WebDriver (here, Java) as shown in the image below.

selecting-langauge-specific-selenium-client-java-appium-installation

Step 10: To Install Eclipse

For the installation of Eclipse, use the official Eclipse site, https://www.eclipse.org/downloads/#

As shown in the below image, select the download link based on your specifications such as 64 bit or others. 

selecting-eclipse-download-link-appium-installation

Soon after the installation process, open the Eclipse editor and select Workbench wherein, create a Java Project with a Java Class

creating-java-project-with-eclipse-editor

Now, download Selenium (a Java-specific WebDriver). Now, it’s all about adding the external jars. Add the java.client jar into the Java Library. Next, import the two jars of Selenium with it’s libraries to your system and add them into the Java Library. That’s it, you now all set to start your base program using Appium. 

In this article, you came across a brief glimpse about Appium, its features and significance in mobile automation. Also, the installation and configuration of necessary tools and technologies such as Java, Android Studio, virtual device (an emulator), Node.js, Appium server and the Eclipse editor. By this, you all set to invoke and activate the Emulator and target application on your Appium server.