Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Insights of Appium

DZone's Guide to

Insights of Appium

Learn about the mobile test automation tool Appium, its structure and benefits, and the features of its new version release.

· Mobile Zone
Free Resource

Download this comprehensive Mobile Testing Reference Guide to help prioritize which mobile devices and OSs to test against, brought to you in partnership with Sauce Labs.

Due to the increase of mobile technology, testing needs to compete with the relevant hardware and software complexities in the terms of volume and variety. At this point, test automation is the only key possible to handle the situation. Appium is an automation tool for automating native or hybrid mobile applications. It is a cross-browser test automation tool which is used for writing tests for numerous platforms using the same API and also facilitates code reuse.

What Is Meant by Mobile Automation Testing?

Mobile automated testing implements a structure to repeat a test method and check application outcomes constantly. It is efficient for regression testing all along development. Testing mobile applications is distinct and more complex than testing regular desktop and web applications.

Introduction to Appium

Appium is an open source test automation tool for mobile applications. It allows you to test native, hybrid, and mobile web applications and run automated tests on actual devices, emulators, and simulators.

The Appium library has a RemoteWebDriver class of Selenium API and designed AndroidDriver and IOSDriver classes to perform mobile automation on the platforms of Android and iOS.

Appium Architecture

Appium evolved from Selenium and uses JSONWireProtocol internally to interact with iOS and Android applications by using the Selenium WebDriver

Appium is basically a web server written in Node.js. The server performs actions in the given order:

  • Receives connection from the client and initiates a session.

  • Listens for commands issued.

  • Executes those commands.

  • Returns the command execution status.

So basically, Appium is a client-server architecture.

The Appium server receives a connection from the client in the form of a JSON object over HTTP. Once the server receives the details, it creates a session, as specified in JSON, and returns the session ID, which will be maintained until the Appium server is running. So, all testing will be performed in the context of this newly created session.

The following is a diagram depicting the Appium architecture:

Image titleThere are 3 types of mobile applications that can be automated using Appium:

  1. A native app is an app developed for a particular mobile device or platform (such as Android, iOS, or Windows). For example, iPhone apps are written in Swift, and Android apps are written in Java. Native apps are also better performing and have a high degree of reliability, as they use the underlying system architecture and the device's built-in features.

  2. A mobile web app is an app accessed over a mobile browser. It can be easily accessed via built-in browsers, such as Safari on iOS and Chrome on Android. They are primarily developed using technologies such as HTML5 or JavaScript, which provide the customization capabilities. So, they are basically served from a server and not stored offline anywhere on the device.

  3. A hybrid app consists basically of websites packaged in a native wrapper. They are primarily developed in web technologies (HTML5, CSS, JavaScript) but run inside a native container, thereby giving the feel of a native app. Hybrid apps rely on HTML being rendered in the mobile browser, with a limitation that the browser is embedded within the app.

different types of mobile apps.

The Appium server essentially exhibits a REST API which performs the following actions:

  • Receives connection from the client.
  • Listens to the command.
  • Executes the command.
  • Responds back with the command execution status.

Workings of Appium

Appium is identical to Selenium in terms of intercommunication and architecture. It adopts JSON-wire protocol for communication and handles script advancement in languages like C#, PHP, Ruby, Python, Java, and JavaScript.

Appium will use the automation frame of reference that comes with the Software Development Kits (SDK) of Android/iOS.

Appium uses UIAutomator on Android and UIAutomation on i)S.

What Is New in Appium 1.6.0?

When Appium 1.6.0 was released, Appium started using UiAutomator 2. Until now, Appium was primarily using Google's UiAutomator framework as the primary way of automating native Android apps.

To use UiAutomator 2, we can specify automationName: uiautomator2.

Prerequisites: This module should support Android 5.0 (API Level 20) and above.

Advantages of Appium

  1. Appium is free and mostly open source.
  2. Appium supports both iOS and Android.
  3. Excellent support for Android 4.1 and up.
  4. No server or code changes required.
  5. Appium has an active Google Group.

Limitations Using Appium

  1. Testing of Android versions lower than 4.2 is not supported in Appium.
  2. Appium has limited support for hybrid app testing.
  3. In Microsoft Windows, there is no support to run Appium Inspector.

Conclusion

Applications which are efficient, rich in quality, and free from bugs are ensured by Appium, which saves a lot of labor, time, and cost of the project. With all these promising growth numbers and trends, learning mobile app development and testing will be worth it and will have huge demand.

Analysts agree that a mix of emulators/simulators and real devices are necessary to optimize your mobile app testing - learn more in this white paper, brought to you in partnership with Sauce Labs.

Topics:
appium ,selenium ,mobile ,mobile testing

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}