官术网_书友最值得收藏!

Appium architecture

Appium is an HTTP server written in Node.js that creates and handles WebDriver sessions. The Appium web server follows the same approach as the Selenium WebDriver, which receives HTTP requests from client libraries through JSON and then handles those requests in different ways, depending on the platform it is running on.

Let's discuss how Appium works in iOS and Android.

Appium on iOS

On an iOS device, Appium uses Apple's UIAutomation API to interact with the UI elements. UIAutomation is a JavaScript library provided by Apple to write test scripts; Appium utilizes these same libraries to automate iOS apps.

Let's take a look at the architecture, which is shown in the following diagram:

Appium on iOS

In the preceding diagram, when we execute the test scripts, it goes in the form of JSON through an HTTP request to the Appium server. The Appium server sends the command to the instruments, and the instruments look for the bootstrap.js file, which is pushed by the Appium server to the iOS device. Then, these commands execute in the bootstrap.js file within the iOS instruments' environment. After the execution of the command, the client sends back the message to the Appium server with the log details of the executed command.

A similar kind of architecture follows in the case of Android app automation. Let's discuss the Appium architecture for Android.

Appium on Android

On an Android device, Appium uses the UIAutomator framework to automate the apps. UIAutomator is a framework that is developed by the Android developers to test the Android user interface.

Let's take a look at the architecture, which is shown in the following diagram:

Appium on Android

In the preceding diagram, we have a UIAutomator/Selendroid in place of Apple instruments and bootstrap.jar in place of the bootstrap.js file.

Appium supports Android versions greater than or equal to 17; for earlier versions, it uses the Selendroid framework. When we execute the test scripts, Appium sends the command to the UIAutomator or Selendroid on the basis of the Android version.

Here, bootstrap.jar plays the role of a TCP server, which we can use to send the test command in order to perform the action on the Android device using UIAutomator/Selendroid.

主站蜘蛛池模板: 云浮市| 丽水市| 南郑县| 甘谷县| 仪征市| 肇州县| 嘉善县| 湘潭县| 博白县| 马鞍山市| 安庆市| 灵川县| 汶上县| 莲花县| 宝丰县| 双鸭山市| 南和县| 甘孜| 若羌县| 白河县| 仪陇县| 缙云县| 台北市| 利川市| 北宁市| 绵竹市| 襄汾县| 蒙山县| 怀安县| 邵阳市| 吴旗县| 维西| 平湖市| 克拉玛依市| 龙川县| 大同县| 云浮市| 冕宁县| 同德县| 萝北县| 孝昌县|