Home Guide Appium Tutorial for Mobile Application Testing

Appium Tutorial for Mobile Application Testing

By Akshay Pai, Community Contributor and Pradeep Krishnakumar, Manager -

Table of Contents

As per a report from Statista, the number of mobile application downloads worldwide is projected to rise from being approximately 178 billion in the year 2017 to over 258 billion by 2022.

Appium Testing Framework

Source: Statista

As the industry has geared up to cater to growing demands for software applications, the global mobile app market revenue is projected at $462 billion for 2019, indicating the massive size of the market.

To tap into this market, companies are targeting customer engagements for their applications by introducing new features every few weeks. To deliver applications in record time, the pressure to deliver a reliable product that is bug-free and performs well is non-negotiable for businesses.

This makes it essential to have a testing process that is not only quick but also has more comprehensive coverage to meet the requirements successfully. Naturally, app testing comes as the best choice to meet these requirements.

To keep up with growing customer expectations, mobile applications must be high-performing and compatible with a fleet of devices that are available in the market. Hence companies are leaving no stone unturned to ensure cross-platform compatibility.

Appium is one such open-source automation framework that makes mobile app testing a lot more efficient by offering scalability and flexibility. It has gained traction in the mobile application industry with its extensive features in a short period. Bitbar, Testbytes, and Intuz have also ranked Appium among the top mobile testing tools with over 35% of market share in Android applications and over 40% share in iOS applications.

Run App Automation Test for Free

Appium Framework

Source: Bitbar

This Appium tutorial aims to offer a detailed overview of the framework , covering all necessary information and benefits that could help you leverage this fantastic automation testing framework for mobile applications.

What is Appium?

Appium is an open-source framework that allows QAs to conduct automated app testing on different platforms like Android, iOS, and Windows.

It automates testing for:

  • Native Mobile Applications that are written using iOS, Android or Windows SDKs
  • Mobile Web Applications that can be accessed using mobile browsers such as Safari, Chrome, or in-built native browser applications for android devices
  • Hybrid Mobile Applications that have a native wrapper around the web view

Appium is a cross-platform testing framework that is flexible, enabling testers to write test scripts against multiple platforms such as iOS, Windows, and Android using the same API. That means QAs can use the same code for iOS as for Android, time and effort.

Similar to Selenium, Appium allows QAs to write test scripts in different programming languages which include Java, JavaScript, PHP, Ruby, Python, and C#.

Run your Appium tests on real Android & iOS devices

Test 100 minutes daily for free.

Architecture of the Appium Framework

Appium is an HTTP server that is written on the Node.js platform whose set up comprises a REST (Representational State Transfer) API and implements Selenium WebDriver. It works on a client/server architecture. Appium allows the uses of the available WebDriver client for firing the tests.

The REST API performs the following actions:

  • Receives the connection from the client-side
  • Listens to the command
  • Executes the command on a mobile device
  • Returns the command execution status as an HTTP response to the client

 

Appium Testing Framework

Source: Gitbooks

Appium allows automation in the context of a session. The client initiates this session as per the client library (Java, JavaScript, PHP, Ruby, Python, and C#), which ends up sending a POST /session request to the server with the help of a JSON object that is termed as “desired capabilities” object.

It is then that the server starts the automation session and responds with a session ID that is further used for sending other commands relevant to the given session.

Run Appium Test for Free

How does Appium work?

Appium interacts with an application automatically, by leveraging the behavior of the various components such as buttons, text boxes and links in the UI.

It can be reused to write and run tests repeatedly against the given application at various sessions.

Here’s how Appium works for Android and iOS mobile devices:

Appium on Android device

Appium uses the UIAutomator framework (or Selendroid), which is meant for testing the Android user interface to automate applications on Android device testing. The bootstrap.jar file works as a TCP server that sends the test command for acting on the Android device with the help of the UIAutomator or Selendroid framework.

 

Appium For Android

Source: Appium Essentials by Manoj Hans

Appium on iOS device

Similar to the case of Android devices, Appium uses the JSON wire protocol for iOS devices as well. Here, it uses Apple’s UIAutomation API to interact with the user interface elements for automated iOS device testing. The bootstrap.js file works as a TCP server that sends the test command for acting on the iOS device with the help of Apple’s UIAutomation API framework.

Appium For iOS

Source: Appium Essentials by Manoj Hans

What makes Appium so popular?

When it comes to mobile app testing, regardless of whether the application is native, hybrid, or mobile web, running on Android, iOS, or Windows, Appium remains the first choice for app automation testing. Its popularity is due to a number of features:

  • It is a server and runs in the background
  • It can be synchronized with the TestNG testing framework offering a wider range of features
  • With an in-built UIAutomator, Appium is capable of producing detailed information logs and has a detailed reporting structure for better analysis of test results better and improved debugging
  • It offers the flexibility to write  test code in different languages (Java, JavaScript, PHP, Ruby, Python, and C#)
  • It offers reusability of the same code for different device platforms such as iOS, Android, and Windows. This saves a lot of time and effort
  • It offers QAs full control of the back-end APIs and databases using the test code. This helps evaluate defects that comes from the back-end APIs or databases
  • Testers do not have to modify or recompile the app under test in any way, as Appium uses the standard automation APIs on all platforms. They don’t need to access the source code of the application under test
  • It allows testing of mobile applications on emulators or simulators or real devices, offering flexibility to choose their testing device and environment
  • It offers cross-platform compatibility, enabling the same tests to run on multiple platforms widening the coverage
  • It offers real-life monitoring of tests making their execution more robust
  • Appium allows parallel execution of test automation scripts on different Android or iOS sessions using UIAutomator, UIAutomation, or Xcode9. This speeds up the testing process and ensures scalability

With so many amazing features, Appium is an automation testing framework that stands out as the best choice for mobile application testing.

How to get started with Appium

To get started with the Appium automation mobile application testing, head over to the BrowserStack’s App Automate documentation to get started. Install the prerequisite components, based on the scripting language and framework chosen.

Alternatively, refer to the following tutorials to run Appium tests on Android and iOS devices:

Get Started with Appium for Free

To perform extensive cross-platform testing for mobile apps, try BrowserStack App Automate, which provides cloud-based, Appium testing on thousands of real mobile devices (Android, iOS, Windows and much more).

On a closing note

To keep up with the demands of fast and reliable testing that spans over various platforms, devices, and versions, automation testing using Appium seems to be the best choice. Preferred throughout the industry, Appium offers feasibility, flexibility, and cost-friendliness above other testing methods, enabling teams to deliver great user experiences within the continuous delivery approach.

Tags
Appium Automation Testing Mobile App Testing

Featured Articles

Mobile Application Testing using Automation frameworks

Appium vs Selenium: Key Differences

Selenium with Java : Getting Started to Run Automated Tests

BrowserStack Logo Test Instantly on 2000+ Real Devices & Browsers Contact us Get Started Free