How Does Appium work?
Let’s have a look at the working of Appium framework with respect to WebDriver Protocol, Client-Server Communication, Appium Sessions and JSON Wire Protocol. Below, are the some working parts of Appium.
- WebDriver Protocol
- Client-Server Communications
- Appium Session
- JSON Wire Protocol
WebDriver
- The WebDriver protocol is used to enable automation of tasks similar to those performed by a human user. The protocol offers a range of commands that simplify common interactions with an application, such as navigating, clicking, or retrieving element states.
- Appium exposes a set of APIs that obeys the specifications defined by the WebDriver protocol. These APIs provide clients with a uniform interface for sending commands and interacting with mobile applications.
Client-Server Communications
- The client could be an automation engineer who has written scripts in Java, Ruby, Python or C#.
- The role of server is played by Appium itself. Appium server acts as a bridge between the client and the mobile device or emulator.
- The client communicates with the Appium server over HTTP using RESTful APIs. Whenever the client sends the command, the client packages the command into HTTP request and sends it to the Appium server’s designated endpoint. The HTTP request usually contains information like desired capabilities, the intended action, and any extra parameters necessary for execution.
Appium Session
- Upon receiving the HTTP request, the Appium server interprets the command and executes it on the connected mobile device or emulator.
- The execution involves interacting with the mobile application’s user interface, simulating user actions such as tapping, swiping, inputting text, etc.
- The Appium server utilizes vendor-provided automation frameworks (e.g., UIAutomator for Android, XCUITest for iOS) to interact with the mobile application’s elements and perform the requested actions.
JSON Wire Protocol
- JSON Wire Protocol is a wire protocol used by WebDriver for communication between the client and the server. It specifies the format of the messages exchanged between them.
- Appium, being a WebDriver implementation, adheres to the JSON Wire Protocol. This means that commands sent from the client to the Appium server, as well as responses from the server to the client, are formatted as JSON objects.
- For example, a command to find an element on a mobile app might be sent as a JSON object containing the element locator strategy and value, and the server responds with a JSON object containing information about the located element.
Architecture of the Appium Framework
Appium framework is used for testing mobile applications to ensure the quality of the software product using a client-server architecture. Appium is capable of automating the testing process seamlessly on iOS, Android, and Windows using the same API. In this article, we are going to explore the architecture of the Appium framework.