Appium is an Open Source Test Automation Framework which can be used to test Mobile Native App, Mobile Web App and Hybrid App (Native+Web). Appium is also “cross-platform” which means that Appium tests can be written to run on multiple mobile platforms.
Appium API allows us to write tests against iOS, Android and Windows platforms. It uses vendor-provided automation frameworks for compilation tasks. The supported frameworks are:
– For Android 2.3+ Google’s Instrumentation
– For Android 4.2+ Google’s UiAutomator/UiAutomator2
– For iOS 9.3 and lower Apple’s UIAutomation
– For iOS 9.3 and higher Apple’s XCUITest
– For Windows Microsoft’s WinAppDriver
The “Appium Drivers” for these vendor-specific technologies are at the heart of supporting tests using Appium in the different platforms.
Appium is based on the Client-Server Architecture and the Appium server needs “Client Libraries” to get instructed on what kind of session to start and what kind of automation to perform. Since, Appium speaks the W3C WebDriver protocol, we can use the standard Selenium client libraries. But Appium can perform additional actions on Mobile Devices which Selenium can’t. Hence, the Selenium client libaries had been wrapped with more functionality (e.g. multitouch gestures, screen orientation) and Appium Client Libraries were formed which is preferred to run our Appium tests. They implement the Mobile JSON Wire Protocol (Mobile JSONWP, which is mobile-specific extension to the JSON Wire Protocol (JSONWP)) and elements of W3C WebDriver specification since the client-server implementation requires a communication spec in general. The purpose of the clients is to provide an interface in a given language, hiding the protocol details. The Appium server does not care what client we are using, it only cares about the protocol. The client libraries are made up of the following languages/frameworks:
- OBJECTIVE C
- ROBOT FRAMEWORK
Appium is based on Client/ Server Architecture. It is simply an HTTP Web Server (written in Node.js) that exposes a REST API. It receives connection requests from client, listens and executes the commands on a mobile device and sends back the response. Due to this architecture, we can write tests on any language having HTTP Client API, but preferably Appium’s own Client Libraries are used. These libraries support Appium’s extensions to the WebDriver protocol.
Once Appium is downloaded and installed on your machine, the HTTP Web Server will be set up exposing the REST API. Once the Appium scripts are executed (from command line, from your favorite IDE or from Appium Desktop), the Client Library will initiate an iOS or Android session with the Appium server and will make a POST (/session) request with the Desired Capabilities JSON object through Mobile JSON Wire Protocol. The server will then send back SessionID to the client to send further commands to the server.
For each session, once the Appium server receives the execution commands, it will send those commands to the vendor-specific testing frameworks (like UiAutomator2, XCUITest) which will then perform the command execution on the mobile devices platform and send back HTTP Responses to the Appium server. The Appium server will then send back responses to the client stating whether the script has been successfully executed or not.