- What is Appium?
- Types of Apps, Platform, Language Supported
- Appium Architecture
- Appium on iOS
- Appium on Android
- Appium Session
What is Appium?
Appium is one of the most popular tools for mobile app automation testing and is used for testing applications on iOS, Android, Windows and FirefoxOS platforms. Appium is an open-source tool for automating native, hybrid, and web mobile apps.It supports all IOS and Android devices.
Appium is Cross-Platform allowing the user to write and execute tests against multiple platforms both IOS and Android by making the use of the same API. Due to this, it allows code reusability in between both IOS and Android test suites.
Appium Supports Multi-Languages:
Types of Application which Appium automates includes the following
- Mobile web apps
A native application is installed on the device.You can download them from App Store or Playstore or sometimes they come installed along with the device.
E.g.Facebook App, WhatsApp, Line, Temple Run etc.
The Native applications are developed with the help of native SDK’s for the mobile platform. For e.g Android apps are developed with Android SDK while iOS Apps are developed with iOS SDK’s (SDK: Software Development Kit). Native app developed for one platform can not run on another platform.i.e If you develop an app for Android then it will not get installed on the iOS device and vice versa.
Mobile Web Applications:
Mobile web applications are generally referred to Mobile websites. These websites are accessible from the browser and you don’t need to install anything in order to access the mobile website.
E.g. www.cars.com can be accessed from Web Browser. However, when accessed from a mobile browser, you can see that all the components adjust itself as per the screen size of the mobile device.
Hybrid apps are the apps which are developed via some native components and some web components. You can consider it as a combination of mobile web and native apps. Hybrid apps can be accessed from the browser and as well as an installable app.
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 does, 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.
Now Let’s discuss how Appium works in iOS and Android.
Appium on IOS:
Let’s take a look at the architecture, which is shown in the following diagram
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.
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.
Appium on Android:
On an Android device, Appium uses the UI Automator framework to automate the apps.UI Automator 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:
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.
A session is a medium to send commands to the specific test application; a command is always performed in the context of a session. A client uses the session identifier as the session Id parameter before performing any command. The client library requests the server to create a session. The server will then respond with a session Id endpoint, which is used to send more commands to interact with the application being tested.
In Next Tutorial we will have a look on Android and Appum Capabilities.