Welcome to Appium Tutorials. Appium is an open-source tool for automating native, mobile web, and hybrid applications on iOS and Android platforms.
In addition to Appium Tutorials we will cover common interview questions and issues of Appium.
Appium is an open-source tool for automating native, mobile web, and hybrid applications on iOS and Android platforms. Native apps are those written using the iOS or Android SDKs.Mobile web apps are web apps accessed using a mobile browser (Appium supports Safari on iOS and Chrome or the built-in 'Browser' app on Android). Hybrid apps have a wrapper around a "webview" -- a native control that enables interaction with web content. Projects like Phonegap, make it easy to build apps using web technologies that are then bundled into a native wrapper, creating a hybrid app
Appium is at its heart a web server that exposes a REST API. It receives connections from a client, listens for commands, executes those commands on a mobile device, and responds with an HTTP response representing the result of the command execution. The fact that we have a client/server architecture opens up a lot of possibilities: we can write our test code in any language that has a http client API, but it is easier to use one of the Appium client libraries. We can put the server on a different machine than our tests are running on. We can write test code and rely on a cloud service like Sauce Labs to receive and interpret the commands.
Automation is always performed in the context of a session. Clients initiate a session with a server in ways specific to each library, but they all end up sending a
POST /session request to the server, with a JSON object called the 'desired capabilities' object. At this point the server will start up the automation session and respond with a session ID which is used for sending further commands.
Interested in mastering Appium Training? Enroll now for FREE demo on Appium Training.
Desired capabilities are a set of keys and values (i.e., a map or hash) sent to the Appium server to tell the server what kind of automation session we're interested in starting up. There are also various capabilities which can modify the behavior of the server during automation. For example, we might set the
platformName capability to
iOS to tell Appium that we want an iOS session, rather than an Android one. Or we might set the
safariAllowPopups capability to
Appium is a server written in Node.js. It can be built and installed from source or installed directly from NPM.
There exist GUI wrappers around the Appium server that can be downloaded. These come bundled with everything required to run the Appium server, so you don't need to worry about Node. They also come with an Inspector, which enables you to check out the hierarchy of your app. This can come in handy when writing tests.
When you download the Appium app you are basically downloading the server. The server is written in Node.js and implements the Selenium WebDriver. It allows one to use available WebDriver client to fire your tests. And then your mobile app acts precisely like a web app where the DOM is represented by View hierarchy.
So this server basically exposes REST api which performs the following actions.
Receives connection from client
Respond back the command execution status
Appium on iOS
In 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.
Check out the top Appium Interview Questions now!
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.
In the preceding diagram, we have a UIAutomator/Selendroid in place of Apple instruments and
bootstrap.jar in place of the
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.
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.
Limitations Of Appium
There are few limitation in appium right now.
-For Android, No Support for Android API level < 17.
-Script execution is very slow on IOS platform.
-Gestures support is limited.
-No support for Toast messages.