Do you know how the Appium testing tool works? If not, then refer to this guide to learn about it.
What is Appium?
Appium is a free mobile application UI testing framework that enables testing of web, hybrid and native applications and supports automation testing on a simulator, emulator, and actual devices.
It provides cross-platform app testing, which means a single API is applicable for both iOS and Android test scripts.
It is independent of the mobile device operating system as Appium has a wrapper or framework that converts Selenium WebDriver into UI Automator(Android) Or UI Automation(iOS) commands as per the device type and not the operating system type.
Appium is an HTTP server jotten in the programming language – Node.js that seamlessly controls WebDriver sessions. The Appium server gets HTTP requests in JSON format from client libraries. Depending upon the running platform, these requests are then controlled in multiple ways.
It has the client-server Architecture, which includes three critical components in it:
- Appium server
- Appium client
- End device
The Appium server uses Node.js to write programming languages.
It gets command and connection requests in JSON format from the Appium client and performs that command on different platforms and mobile devices. It’s crucial to install the server in the machine and begin before invoking the automation code.
The server then communicates with several platforms like ios and Android by creating a session with end devices. It’s an HTTP server scripted in the programming language – Node.js. It reads the received HTTP requests from the client libraries plus shares these requests with the right platform.
To start the server, users should download or install the source from Npm. It also offers the server’s GUI version. You can download it from Appium’s official website.
We call automated scripted code an Appium client.
The code gets jotted in any programming language, such as Python, PHP, Java, etc. This automation script has all the configuration details of the application and mobile devices. Also, have the logic code to pace the test cases of the scripted app.
The end device is a real-time emulator or a mobile device. The automation scripts get executed by the Appium server in the end device with the help of commands from the client.
The Appium Client, responsible for holding the configuration details plus the automation script for the test cases, sends the command in JSON format to the server. The automation script is changed into JSON format by in-built jar files.
The Appium server then recalls the command and builds a connection with the corresponding end device. After having the connection, it forces the execution of test cases in the end device. And the End device retaliates to the respective request in the form of an HTTP server to the Appium.
The test cases populate the log of all the actions performed in the emulator/device as and when the test cases are executed in the emulator/mobile device.
How Does Appium Work?
The mobile testing tool Appium works differently on different devices. So, let’s look into the working of various platforms.
Working on Appium on Android
Appium takes the help of the UIAutomator framework to communicate with the UI elements of the app on an Android device. Android developers develop the UI Automator framework to test its UI.
Instead of UI Automation API, we have a Selendroid/UIAutomator and bootstrap.jar rather than a bootstrap.js file. It encourages all Versions of Android that are equal to or greater than 17; for earlier Android versions, Appium uses the framework of Selendroid.
When we execute the test scripts, Appium sends the commands in JSON format to the Selendroid or UIAutomator based on the version of Android. Here, bootstrap.jar pretends to be a TCP server, which we can leverage on the Android device using Selendroid/UI Automator.
Working of Appium on iOS
When we execute the test scripts, the test scripts commands are taken through an HTTP request in JSON to the Appium server. The server sends the command to the instrument, and the instruments look for the bootstrap.js file.
These commands are then executed on the bootstrap.js file within the environment of iOS instruments. After the command’s execution, the client reverts the message(failure/success) to the server with the log details of the executed command.
But there are lots of speculations regarding the installation of Appium. People take it as a convoluted and time taking task because of the high dependency issues of Appium. The entire process is simple and needs to be performed without missing any step.
One needs to depend on the following factors to install the Appium:
- Appium Client Libraries
- Appium Server
- Android Studio
- Selenium Libraries
We hope you have got the essential learning of what Appium is all about, Appium’s architecture, how Appium works, and the installation of Appium.
So, to learn more about Appium testing tools, you must look into this guide to grave all your mobile testing queries.