Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Appium Essentials

You're reading from   Appium Essentials Explore mobile automation with Appium and discover new ways to test native, web, and hybrid applications

Arrow left icon
Product type Paperback
Published in Apr 2015
Publisher
ISBN-13 9781784392482
Length 188 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

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.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime