Learn Appium for Mobile Automation Testing

Mobile applications have almost become a part of everyday life these days. There is an abundance of mobile applications for anything and everything today. As the competition is increasing in this area, testing of every app being released is gaining importance to ensure a bug free and consistent app which is being released to users. Identifying the bugs and fixing them at beta stage of development cycle is utterly important to save your app’s reputation and ratings on the market and reach your business goals.

Automating the mobile app testing process is vital in increasing efficiency of testing and also saves a lot of time involved in testing. There are many automation tools available for mobile testing in market. In this article, we introduce to you the most widely used tool for mobile automation – Appium.

Why Appium?

Appium is an open source tool which can be used to automate the UI and functional testing of mobile applications. Mobile applications can be of three types- Native, Hybrid and Web app. Native apps are apps which are developed specifically for one platform (iOS, Android or Windows) and are written using iOS, Android or Windows SDKs. Mobile web apps are websites that render on mobile browsers. Hybrid apps are apps designed for all platforms altogether and are build with technologies such as HTML and CSS. Appium supports testing of all these three types of mobile applications.

Thus, Appium has been designed in such a way that it offers maximum flexibility needed for automating mobile apps to its users and meets all your automation needs. It doesn’t restrict you to some specific framework or language to write and run your tests. You also need not compile your app or modify it in any way to automate it unlike in some other tools available for mobile automation.

Today we know that every mobile app is developed in at least two of the platforms- Android and iOS, the tool you use for automation should allow for cross platform testing which Appium does. Appium allows code reuse between Android and iOS platforms as there is no dependency on the mobile OS for Appium.This is because Appium has a framework in which the vendor provided frameworks depending on the device type, UI Automation(iOS) and UIAutomator(Android), are wrapped in one API, the WebDriver API. So the wrapper just translates Selenium WebDriver commands into UIAutomation(for iOS) or UIAutomator (for Android) commands depending on the device type. Appium also supports different languages for which Selenium client libraries are available including Java, Python, C#, Perl, JavaScript, Ruby, Perl, PHP, etc.

Here is a summary of the major points on why Appium is the most popular choice for mobile automation.

  • Open source and free.
  • Can automate native, web and hybrid apps.
  • Supports multiple languages for writing scripts.
  • Uses the same API for testing across different platforms- Android, iOS or windows.
  • It can be integrated with Continuous integration tools like Jenkins and Bamboo.
  • It supports various mobile browsers- like Safari on iOS or chrome or the built in browser on android.
  • Appium allows you to run your tests in real devices as well as emulators.
Appium Architecture

In essence, Appium is a webserver which exposes as a REST API. When you download and install Appium, in fact the server is set up on your machine. It is an HTTP server written in Node.js platform and implements the Selenium WebDriver. While using Appium, we use the WebDriver client which supports Appium’s extensions to the WebDriver protocol, to fire our tests and the mobile app under test acts just like a web app. So, the webserver basically receives connections from the WebDriver client, listens and executes the command on the mobile device and responds back the command execution status as an HTTP response.

Appium uses standardized JSON wire protocol for communication over HTTP protocol. To execute the commands on mobile device, the vendor provided mobile automation frameworks are used to drive the user interface of the app.

Getting started with Appium

We have now seen the architecture of Appium. It might look a little complex and setting up Appium also takes some time as it is not just downloading and installing any other tool. It has some pre requisites and some steps involved for the set up. But trust me, once it is done you are going to love this tool for its capabilities. It is almost same as Selenium and if you know Selenium, it’s going to be almost same thing you have to do like coding in Selenium. Appium supports all methods in Selenium and there is no need to learn many new things for using Appium if you know Selenium.

Now, even if you are not familiar with Selenium don’t worry, there are lot of tutorials available online that help you start from scratch. Given below are some of the online courses and tutorial available to get started with.

Best Tutorials for Selenium

Best Courses For Selenium

However, if you already decided to take a deep dive, here are some of the best courses we found on Selenium.