Software Testing Automation Using Appium
Software Testing Automation Using Appium
Chapter 1
INTRODUCTION
Software testing phase within the software development lifecycle is the phase which
ultimately determines how sellable our product is. It is in this sense that a lot is being
explored in terms of optimizing testing. With the advent and ever increasing use of mobile
technology, testing also has to keep up with the complexities in terms of both volume and
variety. The volume is in terms of the number of test cases involved while testing. The
variety is in terms of defining the test cases such that it accommodates the nuances of touch
screen, multitasking, mobile internet and other gesture recognitions. Automation is the
solution to deal with volume and ironically automation also is the challenge to deal with
variety. This is to emphasize on the need for automating testing for mobile technology. One
such open source tool for software automation is called Appium which will give us an insight
to providing solutions to the above mentioned challenges.
Learning from the tools available for automating testing for desktops, tools like MonkeyTalk,
KIF, Calabash, etc. were developed for mobile native applications. Most of these tools
required an extra agent that needed to be compiled along with the application code. The extra
agent was needed so that the tool can interact with the mobile application. The libraries of
this extra agent had to be removed at the time of submitting the application to the Store.
Appium, on the other hand, does not need any such extra agents to be included in the original
code. Appium can be termed as a revolutionary tool that can completely change the testing
process in a much efficient and swift way.
2015-2016
Page 1
2015-2016
Page 2
You should not have to recompile your app or modify it in any way in order to
automate it.
ii.
You should not be locked into a specific language or framework to write and run
your tests.
iii.
A mobile automation framework should not reinvent the wheel when it comes to
automation APIs.
iv.
2015-2016
Page 3
2015-2016
Page 4
Chapter 2
SYSTEM DESIGN
The structures of the Appium project live out this philosophy. We meet the first requirement
by using vendor-provided automation frameworks under the hood. That way, we don't need
to compile in any Appium-specific or third-party code or frameworks to your app. This
means you're testing the same app you're shipping. The vendor-provided frameworks used
are as follows:
iOS: Apple's UIAutomation
Android 4.2+: Google's UiAutomator
Android 2.3+: Google's Instrumentation. (Instrumentation support is provided by
bundling a separate project, Selendroid)
We meet the second requirement by wrapping the vendor-provided frame works in one API,
the WebDriver API. WebDriver (aka "Selenium WebDriver") specifies a client-server
protocol (known as the JSON Wire Protocol). Given this client-server architecture, a client
written in any language can be used to send the appropriate HTTP requests to the server.
There are already clients written in every popular programming language. This also means
that you're free to use whatever test runner and test framework you want; the client libraries
are simply HTTP clients and can be mixed into your code anyway you please. In other
words, Appium & WebDriver clients are not technically test frameworks they are
automation libraries.
We meet the third requirement in the same way: WebDriver has become the de facto
standard for automating web browsers, and is a W3C Working Draft. Why do something
totally different for mobile? Instead we have extended the protocol with extra API methods
useful for mobile automation
2015-2016
Page 5
2015-2016
Page 6
2015-2016
Page 7
Essentially, we support a subset of the Selenium WebDriver JSON Wire Protocol and
extend it so that we can specify mobile-targeted desired capabilities to run our test
through Appium.
2.3.1 Inspector
The Appium Inspector records and plays native application behavior by inspecting DOM
and generates the test scripts in any desired language. However, currently there is no
support for Appium Inspector for Microsoft Windows. In Windows, it launches the
Appium Server but fails to inspect elements. However, UIAutomator viewer can be used
as an option for Inspecting elements. It helps the test engineer to detect, inspect and
interact with user interface elements. Inspector provides the test engineer with the path of
every single element present of the current screen on simulator or a real device. Inspector
has a record function which helps in generating scripts automatically upon interaction
with UI elements. Inspector provides different ways of interacting with the GUI of the
application under test.
2015-2016
Page 8
2.3.2 Doctor
Appium provides a doctor for a very simple task i.e. to run a check whether all the
components required for the running of test and simulators are met before hand. It shows an
error if one or more components required are missing and without that the test cannot be
run. The results of the doctors inspection of requirements are shown on the Appium server
window. If all conditions are met, there is a green tick in front of each requirement.
2015-2016
Page 9
2.4.2 Session
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.
2015-2016
Page 10
2015-2016
Page 11
Chapter 3
IMPLEMENTATION
3.1 Working of Appium
The scripts and the desired capabilities can be written in any programming language
including Python, Perl, Java, Ruby, C#. Here, an eclipse IDE is used to write capabilities
and scripts both on Windows platform. The capabilities for Android app are being tested on
the emulator. For an iOS app, just the desired capabilities need to be changed, for instance,
device name will become iPhone and platform name will become iOS.
2015-2016
Page 12
2015-2016
Page 13
2015-2016
Page 14
2015-2016
Page 15
2015-2016
Page 16
2015-2016
Page 17
2015-2016
Page 18
2015-2016
Page 19
2015-2016
Page 20
2015-2016
Page 21
2015-2016
Page 22
3.6.2 Snapshots
Snapshot 1
The fig 3.5shows the home screen of Appium.
2015-2016
Page 23
2015-2016
Page 24
3.7.2 Disadvantages
2015-2016
Page 25
CONCLUSION
Continuous advancements in mobile applications is taking place and today we need high
performance applications designed, developed and developed as quickly as possible
Testing is the most important step before launching such applications especially when
developed for use in critical areas of the market where a small error can lead to a huge
failure. Thus, automation of software testing is the new trend taken up by developers to
ensure a high performance application in a short period. Appium seems to be much more
promising in this aspect as it delivers powerful features to test engineers which can save a
lot of time, labor and cost of the project. Thus, Appium provides a complete new
revolution in automation testing this promises efficient, bug-free and quality-rich
applications.
2015-2016
Page 26
BIBLIOGRAPHY
[1] Hyungkeun Song, Seokmoon Ryoo, Jin Hyung Kin, An Integrated Test Automation
framework for testing on heterogeneous mobile platforms - IEEE (2011)
[2] Domenico Amalfitano, Anna Rita Fasolino, Portfirio Tramontana, A GUI Crawlingbased technique for Android mobile application Testing IEEE (2011)
[3] Pallavi Raut, Satyaveer Tomar, Android Mobile Automation Framework IJECS
(2014)
[4] Anuja Jain, Swarnalatha P, M R. Ghalib, S. Prabhu, Web-Based Automation Testing
Framework IJCA (2012)
[5] www.appium.io 2014
[6] https://github.com/saucelabs/appium-tutorial 2014
[7] Leckraj Nagowah and Gayshree Sowamber, A Novel Approach of Automation
Testing on Mobile Devices IEEE(2012)
[8] Gaurang Shah, Prayag Shah, and Rishikesh Muchhala, Software Testing Automation
using Appium, IJCET (2014)
2015-2016
Page 27