Appium Tutorial | Introduction to Android and IOS Mobile Apps Testing

Appium Tutorial for Testing Android and IOS Mobile Apps

Introduction to Mobile Testing and Appium

What is Mobile Testing?

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.

Explore more types of mobile application testing

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 Appium vs. Selenium—Architecture, Functionality, Applications

Prerequisites for Setting up Appium

Prerequisite for Setting up Appium

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

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

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: Mobile Cloud Testing 101 | Introduction and Implementation

Your automation journey starts here.
Scroll up