Thousands of apps are released every day, be it native, hybrid or web apps, and they all fall into different categories ranging from highly secure banking apps to fun inducing video games. At the rate at which apps are released, it is important to check them for functionality, consistency and usability. There are powerful testing tools that would help you with the performance of hybrid, mobile web and native mobile applications, and some of them are cross platform.
Appium, though essentially an HTTP server, can manage WebDriver sessions, as it is really an open source project for cross-platform test automation. And since it is supported and developed by Sauce Labs, it is easily picked up by the WebDriver community for mobile apps.
Appium can support any tests on any framework and in any language. Testing is simplebecause you don’t have to modify the codes for testing. The best thing about Appium is that it supports all kinds of apps, so you can run the tests on either iOS or Android on real devices.
Mobile application testing can be automated or manual. By checking the application and the outcome, programmers can decide on any changes to be made if required. By constantly checking the application outcome, testing can be done successfully, thereby expediting the process of validating the software.
The need for mobile automation testing stemmed from the explosive growth of smartphone applications since 2007. The total number of applications in App Store and Google Play jointly exceeds one million+. As all these applications are competing for user attention, maintaining the quality of apps has become quintessential.
Nevertheless, there are some challenges that mobile test automation suites have to go through. Some of them are:
Appium is cross-platform and allows you to write against multiple platforms because it allows for code reuse between Windows, Android and iOS test suites. Being an open source tool, it is the perfect choice for automating native, mobile web and hybrid applications on their respective platforms.
This is the Appium philosophy. All the mobile automation needs are based on the philosophy in these four tenets:
1. You shouldn’t have to recompile your app or modify it in any way in order to automate it.
2. You shouldn’t be locked into a specific language or framework to write and run your tests.
3. A mobile automation framework shouldn’t reinvent the wheel when it comes to automation APIs.
4. A mobile automation framework should be open source, in spirit and practice as well as in name!
By using Selenium WebDriver, you can write tests through Appium via JSON for iOS automated testing. It acts as a wrapper that translates Selenium commands into iOS and Android commands, making the framework Selenium WebDriver compatible. Selenium supports the following languages — Java, Python C#, Ruby, JavaScript, PHP. Appium also has AndroidDriver and iOS Driver classes for mobile automation on Android and iOS platforms as well.
In the website: www.appium.io, an impressive trifecta of Appium is mentioned.
1. You don’t have to modify codes or do a recompilation of your app because of the standard API that it uses in all the platforms. Appium makes it easy to write your tests against iOS and Android platforms with same API, but you will still need separate iOS and Android scripts, as the UI elements are separate on both the platforms.
2. Programmers can use any WebDriver compatible language to write the tests for the apps. Examples would be Perl with Selenium WebDriver API, Objective-C, Java, PHP, C#, Python, Clojure, Ruby, JavaScript with Node.js and language-specific client libraries.
3. Programmers can use the testing framework of their choice. This is a far cry when compared to the WebDriver protocol that you had probably used previously. For example, you can write tests only through JavaScript through the UI Automation of library for Apple. Similarly, for the UIAutomator of Google, you can write only Java based tests. This changed when Appium came on the scene.
The possibility of true cross-platform native mobile automation through Appium became a blessing, a reality.
Check out this video to learn how Appium helps you to make your mobile app testing easier.
Appium is highly regarded in the mobile testing world because it makes your mobile app regression testing easy. This is a great boon for large applications where you have continuous feature updates and new functionalities. And it allows you to use any testing framework because of its bevy of multiple platforms and languages.
Now let’s get a tad deeper into the basics of Appium. Appium is an HTTP web server written in Node.js platform, and evolved from Selenium. When Appium is downloaded and installed, a server will be set up on your machine, exposing a REST API. It drives the iOS and Android session using WebDriver JSON. You must, however, pre-install Node.js on the system before initialising Appium Server.
Selenium WebDriver and JSON Wire Protocol let you have internal interaction with iOS and Android applications.
Appium is a client-server architecture. This means that it receives connections from a client, listens for commands, performs those commands on the mobile device, responds with an HTTP response representing the result of command execution. Since Appium is a client/server architecture, you have a lot of possibilities, because you can easily use any of the Appium client libraries, even though you can write tests codes in a language with http client API.
There are other automation tools in the market like MonkeyTalk, Calabash, Frank, KIF, etc. that help you automate mobile native apps, but you need extra agents compiled in your application to make them interact with the mobile app. This is a disadvantage because it becomes slightly different from the apps you are submitting in the App Store, and you would have to remove those automation agent libraries and only then submit the app.
It is also worth noting here that Appium is at heart a web server that exposes a REST API.
Since you have a client/server architecture, there are a lot of possibilities with Appium. You can use one of the Appium client libraries or you can write the test code in any language that has an HTTP client API. You can put the server on any machine, irrespective of the machine your test is running on. Write the test code and rely on SauceLabs, a cloud library, to receive and interpret the commands.
A set of keys and values are sent to the Appium server to specify the type of automation session to be initiated. It is also possible to modify the server behaviour during automation.
All the automation tasks are performed under the context of a session. When the client initiates a session with a server, a Post/session request is sent to the server with a JSON object called the Desiredcapabilities object. This way, the session starts with an automation session and shows a session ID through which further commands are sent.
Appium is written in Node.js. There are two ways to do this — it can be built and installed from the source, or installed directly from NPM:
$ npm install -g appium
$ appium
Client libraries like Java, Ruby, Python, PHP, JavaScript, and C# support Appium extensions to the WebDriver protocol. Programmers can use these client libraries instead of your regular WebDriver client while running Appium.
You can download the GUI wrappers around Appium server. They have all that you need to run the Appium server, so don’t worry about the Node. An additional benefit is the possibility to check the hierarchy of your app when writing and running the tests. This is done with the help of Appium provided Inspectors.
Appium works almost like the Selenium server which listens and understands http requests from Selenium client libraries, and then performs the tasks in different ways depending on which platform it is testing on. Similarly, Appium starts a test case on a device spawning a server, performing tasks after listening to the proxied commands from the main Appium server.
Other major benefits of Appium with an Automation framework are:
1. Better quality of product — Appium testing helps you release high quality, functional apps when compared to other frameworks because the testing is so accurate and realistic.
2. Faster release cycles — As everything is done automatically, there is no intervention or halt while the testing is going on, and you can enjoy faster release cycles.
4. “Closest to live” testing scenarios — Since the app is tested as it is, you don’t have to add extra codes in it. This gives you a real life scenario of how your app will perform when it gets into user’s hands.
Since all the complexities remain under the hood of the Appium server, irrespective of the platform being used, the programmer will be able to automate the testing processseamlessly. As Appium opens the door to cross-platform mobile testing, programmers can conduct the tests on multiple platforms. And programmers do not have to add extra agents to make it automation friendly. They can test the app in the same way they are planning to submit it to the app stores.
In short, the entire work release flow process becomes easy because Appium makes the release cycle short and facilitates bug free versions of your app, all with a very low TMM (Time to Market).
Wondering which tool to use for automated testing of your mobile app? We can guide you…