0% found this document useful (0 votes)
81 views4 pages

Research On Mobile Application Automation Testing Technology Based On Appium

Uploaded by

alejandra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views4 pages

Research On Mobile Application Automation Testing Technology Based On Appium

Uploaded by

alejandra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

2019 International Conference on Virtual Reality and Intelligent Systems (ICVRIS)

Research on Mobile Application Automation Testing Technology Based on Appium


Wang Junmei, Wu Jihong
Dalian Neusoft University of Information, Dalian, Liaoning, 116023, China
[email protected]

Abstract—Aiming at the problems of how to improve the


quality of mobile applications and user experience II. THE MOBILE TESTING BASED ON APPIUM
continuously, and how to use automation testing technology
rationally to avoid wasteful duplication of effort, a design A. The mobile application testing process
method of the automation testing based on Appium is Because most enterprises need to put mobile
proposed. Appium is mainly aimed at the automation of user applications on the market quickly, mobile applications are
interface testing and business function and process testing. usually developed in the agile development model. Agile
Appium is applicable to testing native, Web applications or
development is characterized by its development speed and
hybrid mobile applications, and it is a cross-platform testing
embracing change. Agile development takes the evolution of
framework, which supports mobile application testing on iOS,
users' needs as its core, and adopts an iterative and step-by-
Android and Firefox OS platforms. On Appium clients ˈ
automation testing scripts can be run to drive the automation
step approach to software development. That is to say, the
testing, and Appium testing scripts can be written in Python,
whole development process is divided into several iteration
Ruby, C#, Java, Objective-C, JavaScript and other languages. cycles. Each iteration cycle usually lasts for a short period of
The experimental results show that the proposed method of time, usually 1 to 6 weeks. In agile development, software
automation testing based on Appium can verify the mobile projects are divided into several sub-projects at the
application software effectively, improve the testing efficiency beginning of construction. The results of each sub-project
and help enterprises save costs. have been tested, and have the characteristics of visibility,
integration and operational use. In other words, a large
Keywords- Appium; Mobile; Application; Automation; project is divided into several interrelated, but also
Testing independent small projects, and completed separately, in the
process of which the software has been in usable state. In
agile development, every iteration has requirements to be
I. INTRODUCTION developed. In each iteration, developers design and code for
In recent years, with the rapid development of wireless the requirements of the iteration, and testers do test the
communication network and the gradual evolution of smart software according to the requirements.
phone applications from lightweight applications to more So what is the testing process in agile development?
complex applications, the automation testing of applications First, in each iteration, testers need to review the
has become increasingly important [1]. The application of requirements of the iteration to fully understand the
requirements and find errors or omissions in the
smartphone brings about a new revolution in software
requirements during the review process, then design and
testing technology. Compared with traditional testing,
write test cases according to the requirements. After the
mobile phone testing breaks away from the traditional completion of test case writing, other members of the project
architecture of PC in hardware, and is quite different in the team need to be invited to participate in the test case review
way users interact. Mobile software has unique operation to ensure the correctness of test cases and requirements
modes in use, such as user's sliding, tapping and clicking coverage. After the test case is completed, if the coding of
operations. How to achieve the automated testing execution the tested module has been completed, the test environment
on mobile clients has become the difficulty in this kind of can be built and the test can be executed. During the
testing [2]. Due to the coexistence of iOS and Android execution of the test, if defects are found, the defect report
operating systems, most mobile applications need to support needs to be submitted. After the defect is modified, the
multiple platforms, and their infrastructure is different, defect needs to be retested. When all the test cases of the
which makes the mobile automation testing framework have iteration are executed and passed, the testing task for this
higher requirements for compatibility [3]. How to select iteration is completed, and then the requirement review for
suitable automation testing tools to test mobile efficiently the next iteration can be started. When the development and
under limited human and material resources has become a testing of all iterations are completed, all functions of the
major problem faced by enterprise R&D departments. This software version are developed, system testing and
paper discusses the mobile application automation testing acceptance testing of the software can be carried out.
technology based on Appium, and shows its flexibility and B. The mobile application testing environment
effectiveness. At the beginning of the test design, testers first need to
consider the test environment. In the reality of mobile
devices and platform fragmentation, it is impossible for

978-1-7281-5050-5/19/$31.00 ©2019 IEEE 247


DOI 10.1109/ICVRIS.2019.00068

Authorized licensed use limited to: Escuela Superior de Ingeneria Mecanica. Downloaded on October 27,2022 at 15:48:34 UTC from IEEE Xplore. Restrictions apply.
testers to exhaust all the versions of devices and operating
systems to achieve full testing coverage. With limited time
and effort, we can achieve as much testing coverage as
possible from the perspective of input-output ratio. Because
most mobile applications support iOS and Android operating
systems, it is necessary to test mobile applications in both
iOS and Android systems. The version of the operating
system to be tested should cover the version of the operating
system used by the vast majority of current users. The 
mobile devices tested should choose the tablets and mobile Figure 1. Appium supports iOS schematics
phones with high market share.
For Android testing, Appium server forwards the
C. Test contents of mobile applications received request to bootstrap.jar installed on the mobile
The following testings need to be done on mobile device. Bootstrap is responsible for monitoring Appium
applications. commands and calling UiAutomator on the mobile device to
1) user interface testing implement the operation. Finally, Bootstrap returns the
2) business function and process testing execution result to Appium server, and Appium server
3) performance testing returns the execution result to the client. Figure 2 is the
4) installation/uninstallation testing schematics for Appium supporting Android.
5) software upgrade testing
6) security testing
7) horizontal and vertical screen testing
Appium is mainly aimed at the automation of user
interface testing and business function and process testing.
III. APPIUM INTRODUCTION

A. Appium overview
Appium is an open source automation testing tool with
the following characteristics:
1) It is applicable to testing native, Web applications or 
hybrid mobile applications [4]. Mobile native applications Figure 2. Appium supports Android schematics
refer to applications written in iOS or Android SDK. Mobile
Web applications refer to the applications accessed by
mobile browsers. Hybrid applications refer to native code IV. EXAMPLES OF APPIUM AUTOMATION TESTING FOR
encapsulating web views, native code interacting with Web ANDROID APPLICATIONS
contents.
2) Appium is a cross-platform testing framework, which A. Android overview
supports mobile application testing on iOS, Android and Android is a free and open source operating system
Firefox OS platforms. based on Linux. It is mainly used in mobile devices, such as
3) Appium test scripts can be written in Python, Ruby, C#, smartphones and tablets, led and developed by Google and
Java, Objective-C, JavaScript and other languages. Open Handset Alliance. The four major components of
B. Appium principle architecture Android development are Activity, Service, Broadcast
Receiver, Content Provider. Android applications are
Appium is a CS model tool that drives Android and iOS composed of various components that can be invoked
applications based on web driver protocols. For the testing separately. For example, a component can be a single
on iOS platform, Appium iOS encapsulates Apple's "Activity" that provides a view for the user interface, or a
Instruments framework, mainly uses UI Automation in "Service" that performs work independently in the
Instruments. Mobile devices are monitored by injecting background [5]. Activity is an application component that
bootstrap.js, bootstrap.js returns the execution results to provides an interface. Master Activity is the first object to
Appium server, and Appium server returns the results to start when the user taps on the application icon. Other
Appium client. Figure1 is the schematics for Appium components, such as broadcast receiver and service, support
supporting iOS. the application to perform background tasks without an
interface. “APK” is the suffix of Android application and the
abbreviation of Android Package, namely Android
installation package. It can be installed by transferring APK
files directly to an Android simulator or an Android real
device for execution.

248

Authorized licensed use limited to: Escuela Superior de Ingeneria Mecanica. Downloaded on October 27,2022 at 15:48:34 UTC from IEEE Xplore. Restrictions apply.
B. The setup of Appium automation testing environment device. If the device exists, it means that the connection
To test the Android application using Appium, the steps between the device and the computer is good. Then start
to set up the testing environment are as follows: Appium Desktop. The Appium Desktop startup view is
1) Set up Android development environment. When shown in Figure 3. On this view, just click the "Start Server"
configuring the Android development environment, the first button, and the Appium Server is started. Click the "Start
step is to get the ADT installation file online for installation. Inspector Session" button to start Appium Inspectorˈand
For example, adt-bundle-windows-x86_64-20140702.zip is fill in the correct platformName, appPackage, appActivity,
used for Windows 64-bit operating system. It provides many deviceName and noResearch information (as shown in
functions, which can control the mobile device and obtain Figure 4). Platform Name is Android; appPackage is the
various data of Android. After downloading and package name found by "aapt" command; appActivity is the
decompressing the installation file, system variables need to entry activity name found by "aapt" command. deviceName
be configured on the computer, for example, download and can be customized. If noReset is set to true, it means the data
decompress the file adt-bundle-windows-x86_64-201702.zip, is not clear when starting the App. Finally, click "Start
the system variable ANDROID_HOME needs to be added; Session" to start the App.
and %ANDROID_HOME%\tools, %ANDROID_HOME%\
build-tools\android-4.4W
and %ANDROID_HOME%\platform-tools need to be added
into the system variable "Path".
2) Install Appium Desktop. Appium Desktop is a
comprehensive tool embedded with Appium Server and
inspector. It can be downloaded and installed directly from
https://github.com/appium/appium-desktop/releases.
3) Install Appium Server. Appium Server is a core service
of Appium. It can receive requests and automate test
execution by manipulating mobile devices. The tool itself
can be installed independently. After the installation, the
command "appium" can be entered in the CMD window and
the port of 4723 is opened locally. This port is a small
service that receives requests from test scripts and automates
testing. If Appium Desktop is installed, the Appium Server
is already embedded. When Appium Desktop is started,
Appium Server is actually started in the background.
4) Install Appium Client. Appium Client is a client
encapsulation library in various languages for connecting to Figure 3. Appium Desktop Startup View
Appium Server. To run the test script successfully, Appium
Client needs to be installed, for example, to run the Python
script, a Python client needs to be installed to drive it locally.
When installing a Python client, you can go to
https://github.com/Appium/python-client to follow the
installation instructions.
C. Automating testing using Appium
After setting up the Appium test environment, we use
Appium to implement the automation testing of mobile
applications on Android platform as follows.
1) Get the App package name and the entry activity name.
App's package name and entry activity information can be
obtained through "aapt" command. The format of "aapt"
command is "aapt dump badging APK filename > log.txt". Figure 4. Appium Inspector Configuration View
Open the CMD window, run the command, put the output
information of the command into the file log.txt, and then 3) Use Appium Inspector to track App elements' properties.
search for "package" in log.txt to find the package name and When the App to be tested is started by Appium Inspector,
search for "launchable-activity" to find the entry activity the App page displayed on the mobile device will be
name. synchronized to the Appium Inspector view. Click on the
2) Start App with Appium. Firstly, install the App to be page element to be tracked, and the Source view of Appium
tested on Android mobile device, connect the mobile device Inspector will be displayed with the elementId, text,
to the computer, and open the settings that allow USB resource-id and other properties of the element, as shown in
debugging on the mobile device. Then, open the CMD Figure 5.
window and enter the command "adb devices" to view the

249

Authorized licensed use limited to: Escuela Superior de Ingeneria Mecanica. Downloaded on October 27,2022 at 15:48:34 UTC from IEEE Xplore. Restrictions apply.
window on the computer and run the command "python app
test.py" directly to drive the script execution. During the
execution of the script, you can see that a login scenario is
automatically completed on the mobile device.

Figure 5. Appium Inspector Source View

4) Use Appium Inspector to simulate manual operations. On


the Appium Inspector view, select the elements that can be
tapped, click the "Tap" button, you can simulate the manual
tap operation; click the "Send Keys" button, you can
simulate the manual character input operation. In this way,
the basic testing for the elements can be implemented via
Appium Inspector.
5) Record test scripts with Appium Inspector. The test script
can be recorded by clicking "Start Recording" button on the
Appium Inspector view. At this time, the tester can click the 
"Tap" or "Send Keys" button to simulate the operation of the Figure 7. Appium Test Script in Python
manual test scenario. Appium automatically generates the
corresponding test script (as shown in Figure 6). After
recording, the test script can be exported to the code of V. CONCLUSIONS
Python, Java and other languages. In summary, using Appium can simulate manual
operations to effectively realize automation testing of mobile
applications. Testers can get the test results by analyzing the
execution log of the automated testing, and work out test
reports. Appium can make regression testing more
convenient [6], and accelerate the development and iteration
of mobile applications. In the actual project, the UI and
functional testing based on Appium can be integrated into
the whole automation platform to achieve continuous
integration and delivery to reduce the cost and risk of
software development.
REFERENCES
[1] Ma Xiaoquan. Design and Implementation of Mobile Automation
Testing System Based on Appium [D]. Southeast University, 2018.
(in Chinese)
[2] Wang Yizhi. Brief Analysis on the Automation Testing of
Smartphones [J]. Modern Telecommunications Technology, 2012
(12): 23-25. (in Chinese)
Figure 6. Appium Inspector Test Script Recording Page
[3] Yao Jiong. Research on Mobile Application Automation Testing
Based on Appium [J]. Software Guide, 2017 (1): 129. (in Chinese)
6) Execute automated tests with Appium Client. If the [4] Appium Automation for Apps [EB/OL]. http://appium.io/.
Appium Client of the corresponding programming language [5] Google Developers, Introduction to Android [EB/OL].
is installed on the computer, the exported test script can be https://developer.android.google.cn/guide. (in Chinese)
executed to drive the execution of the automated test. Figure [6] Linbo. Design and Implementation of Interface Automation Testing
7 below is the login scenario test script "apptest.py" in for an Android Platform App Based on Appium [D]. Huazhong
Python. After exporting the test script, open the CMD University of Science and Technology, 2016. (in Chinese)

250

Authorized licensed use limited to: Escuela Superior de Ingeneria Mecanica. Downloaded on October 27,2022 at 15:48:34 UTC from IEEE Xplore. Restrictions apply.

You might also like