blog

What is Appium and How it works in Android & iOS Mobile Apps

What is Appium and how it works in Android and Ios Mobile Apps

Hello, phubbers! Meaning- someone who continually looks at their mobile phone in a social setting while ignoring the people they are actually with. This is how today people got attached to mobile phones. It is also an agreeable fact that we would forget anything but never fail to use mobile on our daily basis for each and everything.

With the increasing advent of mobile phones, the demand for mobile applications is also increasing rapidly for human needs. This is because mobile applications are convenient to use by people and there are almost 2 million apps are build in both Android and iOS.

On the other hand, we also know the mobile software industry is a chaotic one. Where Quick rollouts along with succeeding maintenance work, mind working all this always keep schedules tight.

In between this chaos, Appium came into the picture – a mobile application automation testing tool provides an opportunity for testers to line up this chaos in a more efficient way. Even though there are many automated tools to test Mobile Apps in the market. Appium plays a great role and it’s widely used.

Eventually, Appium made authentic growth and the demand for skilled Appium professionals increased. So, let’s not delay further learn about the Appium automation tool to know how this made it possible.

Well, by reading this article you will come to know about the following:

  1. What is Appium?
  2. The Connection between Selenium and Appium
  3. Why Should You Choose Appium?
  4. How Does it work in iOS?
  5. How Does it work in Android?
  6. Pro’s and Con’s
  7. Conclusion

1. What is Appium?

It is an open-source, cross-platform automation testing tool designed for all mobile applications and was launched in 2012.  Did you know? with the help of Appium test automation framework, the automation can be done with ease

  • Native apps
  • Hybrid apps
  • Web

Also, know this automation can be run on different operating systems such as

  • Ios
  • Android
  • Firefox OS

But the tool has a major focus on only Android and iOS apps.  Hence it is a cross-platformed tool, we can write tests and test codes on any platform like a windows phone or android app using the same Application Programming Interface. This, in turn, results in large reusable code which is time-saving.

Note: Appium is developed and maintained by Sauce Labs. Presently, Appium version 1.12 is being distributed. It is first started off as a command-line based testing service that can be installed using node.js.With their latest release, they named it as ‘Appium Desktop’, where they have released a robust and refined tool with an intuitive graphical user interface. 

2. The Connection between Selenium and Appium:

Let’s dive in and know about Appium. The most important feature of Appium is the client/server nature. Hence, understanding the Appium is made easy by understanding the Appium architecture.

Server: When selenium RC is used we will typically find out that Appium works in a similar way like selenium server in selenium RC, as it provides communication between mobile device and client. But, Appium is scripted in Node.js, so there is no need to install it again.

Client: Client in Appium describes client libraries like Java, Ruby, Python, PHP, Javascript that are available. This, in addition, supports mobile-specific command over standard selenium commands.

A REST API is exposed once the Appium server is started to the client. A client begins a session with JSON ‘desired capabilities’ object. Here, a  connection is set between a client and the server.

3. Why Should You Choose Appium?

With the plenty of Mobile automation tools available out there, what really made Appium shine in the mobile application testing industry? Maybe reading these points can blow your mind.

  • It is Free and Open Source
  • It has its extension to work in native as well as hybrid mobile applications.
  • Appium code can run on various devices.
  • No Need for Application Source Code 
  • Appium can be written in any language
  • Application not Reinstalled
  • Appium supports  various automation testing tools 

4. How Does it work in iOS?

Appium is a simple HTTP server that is written in node.js. It follows the generic client-server architecture.

When it comes to iOS, Appium proxies command to a UIAutomation script running in Mac Instruments environment. Apple provides this application called ‘instruments’ which is used to do a number of activities like profiling, building and controlling iOS apps. Moreover, it has an automation component where we can write some commands in javascript which uses UIAutomation APIs to interact with the App UI. It also utilizes these same libraries to automate the iOS Apps.

From the above figure, you can see the architecture of the Appium in context to the iOS automation. Here, when we talk about a command life-cycle, it goes in a manner, like the Selenium web driver picks a command form the code like (Element.click) and sends it in the form of JSON through HTTP request to the Appium server. 

Moreover, the Appium server knows the automation context like iOS and Android, so it sends this command to the Instruments command server which until wait for the Instruments command client (written in node.js) to take it up and implement it in bootstrap.js within the iOS instrument’s environment. So, once the command is executed the command client sends back the message to the Appium server which logs everything related to the command in its console. Such a way the cycle continues until all the commands get executed.

5. How Does it work in Android?

Here, with android, the situation is almost similar where Appium proxies command to a UIAutomator test case that runs on a device. UIAutomator is Android’s native UI automation framework that supports running JUnit test cases directly into the device from the command line. Android uses Java as a programming language but Appium will make it run from any of the WebDriver supported languages.

In the above diagram, we can see here we have Bootstrap.jar in place of bootstrap.js which describes a test case when compiled in java. Once it gets launched it spawns a TCP server. Here the TCP server resides inside the device and the client is in the Appium process which is just opposite to the way it is in iOS.

6. Pros and Cons:

The pros and cons of Appium are discussed below in a detailed format

PROS

  • It is free and open-source
  • As this provides cross-platform solutions for both native and hybrid apps
  • It is compatible with Grid and JSON web-driver
  • Programming languages such as C#, PHP, JavaPython, Ruby are supported by Appium
  • App Automation is possible by using Appium
  • Without recompiling the code, it enables to evaluate cross-platform mobile apps
  • It supports simulators, emulators and real devices simultaneously
  • The testers can use the inspector for playback and record tool
  • Independent of the mobile device such that it can be used in any mobile device
  • Has an active google group
  • Excellent support for android versions that are above 4.1

CONS

  • Appium cannot speed up ios app testing without  the use of simulators
  • The testing of the android apps below 4.2 version is not allowed
  • Support for hybrid app testing is limited
  • Gestures support have not yet implemented like to access java library by double click
  • As there is no detailed documentation is there in the form of tutorials
  • Image recognition is very poor, so it needs to do be done through  image handling techniques
  • Appium inspector has not supported in Microsoft Windows.

7. Conclusion:

I hope reading this blog would have helped you in gathering a great idea about Appium as a tool. If you’re interested in building a career in mobile application testing, please check out Zuan’s Appium Certification course. You will be taught about mobile application testing using Appium by our industrial professionals.

Best wishes!


Leave a Reply

How to Start a Career in PHP in India?
Start a Career in PHP in India