Appium: Basics & Architecture

Get introduced to the basics of Appium & its architecture.

What is Appium?

It’s a NodeJS based open-source tool for automating mobile applications. It supports native, mobile web, and hybrid applications on iOS mobile, Android mobile, and Windows desktop platforms.

Using Appium, you can run automated tests on physical devices or emulators, or both.

Appium Architecture

Let’s understand the above Appium architecture diagram.

Appium is a client-server architecture. The Appium server communicates with the client through the HTTP JSONWire Protocol using JSON objects.

Once it receives the request, it creates a session and returns the session ID, which will be used for communication so that all automation actions will be performed in the context of the created session.

Appium uses the UIAutomator test framework to execute commands on Android devices and emulators.

Appium uses the XCUITest test framework to execute commands on Apple mobile devices and simulators.

Appium uses WinAppDriver to execute commands for Windows Desktop apps. It is bundled with Appium and does not need to be installed separately.

Appium - Android visual interaction flow

Let’s understand the interaction flow between the code and the Android device via the Appium server.

  1. The client sends the request to the Appium server through the HTTP JSONWire Protocol using JSON objects.
  2. Appium sends the request to UIAutomator2.
  3. UIAutomator2 communicates to a real device/simulator using bootstrap.jar which acts as a TCP server.
  4. bootstrap.jar executes the command on the device and sends the response back.
  5. Appium server sends back the command execution response to the client.

Appium - iOS visual interaction flow

Let’s understand the interaction flow between the code and the iOS device via the Appium server.

  1. The client sends the request to the Appium server through the HTTP JSONWire Protocol using JSON objects.
  2. Appium sends the request to XCUITest.
  3. XCUITest communicates to a real device/simulator using bootstrap.js which acts as a TCP server.
  4. bootstrap.js executes the command on the device and sends the response back.
  5. The Appium server sends the command execution response to the client.

Now, we understand the basics of Appium, its architecture, and the interaction with mobile devices. Next, we will set up our test environment using Appium.