Appium Tutorial | Introduction to Android and IOS Mobile Apps Testing
Tags: appium, tutorials, mobiletesting, softwaretesting
Published: 2021-08-03 02:24:23

---
title: Appium Tutorial | Introduction to Android and IOS Mobile Apps Testing
published: true
tags: Appium, Tutorials, MobileTesting, softwaretesting
canonical_url: https://www.katalon.com/resources-center/blog/appium-tutorial-mobile-testing/
---
>**Due date: 23:59 p.m Oct 25th, 2021**
>**The State of Quality Report 2021**
>_Wouldn’t it be great to know how peers and experts are staying ahead of their quality assurance game? That’s why we're creating The State of Quality Report 2021 to collect the best QA practices from you, professionals of all levels.
We are happy to offer **the first 100 respondents a $30 Amazon gift card**, along with the final report from the survey results. [Raise your voice!](https://www.research.net/r/medium-devto)_

![Appium Tutorial for Testing Android and IOS Mobile Apps](https://d1h3p5fzmizjvp.cloudfront.net/wp-content/uploads/2020/12/Appium-Tutorial-for-Testing-Android-and-IOS-Mobile-Apps.png)

## Introduction to Mobile Testing and Appium

Mobile testing is a series of tests done to determine the reliability, functionality, and usability of a software application. Mobile testing can be classified into mobile device testing and mobile application testing. Mobile device testing authenticates a device’s quality through verifying and validating its hardware parts and software functions. It tests features such as screen, applications, camera, etc. On the other hand, mobile application testing focuses only on testing the software application’s consistency and functionality. It ensures that the selected application is well suited for the device in terms of hardware, software, connectivity, etc.

There are three types of mobile applications:

- **Native mobile applications**  
This kind of application is built with a specific platform in mind; it can be for Android, IOS, or Windows SDK. They are refined to work on a specific device or platform (i.e., IOS works on Apple devices alone). Examples of such applications are Snapchat, Google maps, Skype, etc.
- **Mobile web applications**  
Mobile web application, as the name implies, works solely on mobile browsers. They are developed in web-based languages such as JavaScript, CSS, and HTML. Also, it does not require installation or update by the users, and it is budget-friendly. Examples of such applications are AliExpress, OLX, Flipkart, etc.
- **Hybrid mobile applications**  
This application combines both qualities of native and web applications. They can be installed on native apps devices but still run through browsers. Examples of such applications are Instagram, Uber, Gmail, etc.

### Appium

Appium is an open-source, cross-platform test automation tool. It focuses mainly on testing mobile applications (Android or IOS) and automates test cases for native, web, and hybrid applications.

Appium supports multiple programming languages, e.g., Java, Python, PHP, Ruby, etc. This allows testers to use any programming language of choice while writing test scripts. It can also run on different OS such as Linux, Windows, Mac, etc. However, Appium cannot be used for testing Android versions lower than 4.2. It also does not perform well on hybrid application testing due to applications’ switching action from the web to native applications.

Read more about Appium in [**Appium vs. Selenium—Architecture, Functionality, Applications, and everything in between**](https://www.katalon.com/resources-center/blog/appium-vs-selenium/)

## Prerequisites for Setting up Appium

![Prerequisite for Setting up Appium](https://d1h3p5fzmizjvp.cloudfront.net/wp-content/uploads/2020/12/Prerequisite-for-Setting-up-Appium.png)

Below is the list of major software and hardware needed for automating mobile applications testing using Appium:

- Download and Install Appium Desktop/Server
- Install JDK (Java development kit)
- Download and Install Install Java and set up the environment variable
- Download and setup Android SDK (Software development kit)
- Install Eclipse
- Install Node JS
- Java-client jars and Selenium jars
- APK – Mobile applications for automation
- Mobile devices
- USB driver for mobile devices

## How Appium works in Android

![How Appium works in Android](https://d1h3p5fzmizjvp.cloudfront.net/wp-content/uploads/2020/12/How-Appium-works-in-Android.png)

In order to meet up with users’ requirements for an application, Appium testing can be used to verify the functionality and reliability of the application. Appium testing on Android devices allows testers to affirm that the applications are functioning as expected in real user conditions. It also helps to ensure optimal consistency in deliveries.

Appium uses the UIAutomator test case to test the Android user interface to automate Android devices. The UI Automator is a native UI automation framework for Android.

### Best Practices for running Appium test on Android devices

- Download the necessary components to run the tests, such as Appium Server, Appium Jar files, and Java.
- Install the Java on your system and set the environment variables.
- Specify the desired capabilities (set of keys and values sent by the client to the server). It can either be set in the test code or in the appium.txt files.
- The test code aids the writing of the Appium test scripts needed to run Appium tests on the Android devices.
- Write your Appium test scripts for your Android devices with the developer mode option enabled.
- Run tests on real Android devices to ensure optimum user-friendliness.

## How Appium works in IOS

![How Appium works in IOS](https://d1h3p5fzmizjvp.cloudfront.net/wp-content/uploads/2020/12/How-Appium-works-in-IOS.png)

Like Android devices, Appium uses Apple UIAutomation API to test the user interface element for automating apps on IOS devices. That is, it utilizes the principle of RESTful services by sending JSON files. These files then work with an iOS application using UI elements such as buttons and text labels through Apple’s UIAutomation API for the application testing.

### Best Practices for running Appium test on IOS devices

- Install and launch the Appium server on your device before starting the testing procedures.
- Get the necessary information of the IOS device used for testing to set the desired capabilities. Details such as the IOS version, bundled, and device name.
- Create a new project in Eclipse to write the Appium test scripts for your IOS devices.
- Inspect the UI for IOS using Appium Desktop Inspector. It can also be used to record functions for accurate debugging.
- Run tests on real devices instead of virtual devices to get the expected results.

## Conclusion

Due to Appium cross-platform ability and ease of use, it has become widely used in testing mobile applications for IOS and Android. However, there is a need to set up major software and hardware components before testing an application with Appium. These components include an Appium server, JDK, Java, SDK, and more. Once all these are in place, you can efficiently test your Android and iOS apps.

**Read more: [Appium vs Selenium](https://dev.to/katalon/appium-vs-selenium-architecture-functionality-applications-and-everything-in-between-2ab3)**

**_The post [Appium Tutorial](https://www.katalon.com/resources-center/blog/appium-tutorial-mobile-testing/) appeared first on [Katalon Solution](https://www.katalon.com)_**.