Mastering Mobile Test Automation
By Feroz Pearl Louis and Gaurav Gupta
()
About this ebook
- Design and develop top-notch, efficient, and scalable mobile automation frameworks
- Develop automation solutions quickly and effectively using real, emulated devices and mobile-specific tools
- A comprehensive and resourceful guide to automate mobile applications through user agents, emulators, and simulators
If you want a complete understanding of mobile automation testing and its practical implementation, then this book is for you. Familiarity with the basics of VB Script and Java along with knowledge of basic testing concepts is essential.
Related to Mastering Mobile Test Automation
Related ebooks
Mobile Test Automation with Appium Rating: 0 out of 5 stars0 ratingsAppium Essentials Rating: 0 out of 5 stars0 ratingsPerformance Testing with JMeter 2.9 Rating: 0 out of 5 stars0 ratingsSelenium Design Patterns and Best Practices Rating: 5 out of 5 stars5/5Instant Approach to Software Testing Rating: 0 out of 5 stars0 ratingsScience of Selenium Rating: 0 out of 5 stars0 ratingsPractical Test Design: Selection of traditional and automated test design techniques Rating: 0 out of 5 stars0 ratingsSelenium Interview Questions & Answers Rating: 5 out of 5 stars5/5Performance Testing with JMeter - Second Edition Rating: 0 out of 5 stars0 ratingsTesting Web APIs Rating: 0 out of 5 stars0 ratingsSelenium with Python - A Beginner’s Guide: Get started with Selenium using Python as a programming language Rating: 0 out of 5 stars0 ratingsTesting with JUnit Rating: 0 out of 5 stars0 ratingsThe Agile Software Tester: Software Testing in the Agile World Rating: 0 out of 5 stars0 ratingsTest-Driven Java Development Rating: 4 out of 5 stars4/5Building a RESTful Web Service with Spring Rating: 5 out of 5 stars5/5ASP.NET Web API Security Essentials Rating: 0 out of 5 stars0 ratingsTest Automation: A manager's guide Rating: 5 out of 5 stars5/5Robot Framework Test Automation Rating: 4 out of 5 stars4/5Mastering Unit Testing Using Mockito and JUnit Rating: 0 out of 5 stars0 ratingsAngularJS Deployment Essentials Rating: 0 out of 5 stars0 ratingsLearning Behavior-driven Development with JavaScript Rating: 5 out of 5 stars5/5Learning Node.js for Mobile Application Development Rating: 0 out of 5 stars0 ratingsAbsolute Beginner (Part 1) Selenium WebDriver for Functional Automation Testing Rating: 5 out of 5 stars5/5Automating Software Tests Using Selenium Rating: 0 out of 5 stars0 ratingsSelenium Testing Tools Interview Questions You'll Most Likely Be Asked: Second Edition Rating: 0 out of 5 stars0 ratingsCucumber Cookbook Rating: 0 out of 5 stars0 ratingsSelenium Testing Tools Cookbook Rating: 3 out of 5 stars3/5
Software Development & Engineering For You
Python For Dummies Rating: 4 out of 5 stars4/5Level Up! The Guide to Great Video Game Design Rating: 4 out of 5 stars4/5Photoshop For Beginners: Learn Adobe Photoshop cs5 Basics With Tutorials Rating: 0 out of 5 stars0 ratingsHow Do I Do That In InDesign? Rating: 5 out of 5 stars5/5Beginning Programming For Dummies Rating: 4 out of 5 stars4/5Modern C++ for Absolute Beginners: A Friendly Introduction to C++ Programming Language and C++11 to C++20 Standards Rating: 0 out of 5 stars0 ratingsLua Game Development Cookbook Rating: 0 out of 5 stars0 ratingsHand Lettering on the iPad with Procreate: Ideas and Lessons for Modern and Vintage Lettering Rating: 4 out of 5 stars4/5How to Write Effective Emails at Work Rating: 4 out of 5 stars4/5Adobe Premiere Pro CC: A Tutorial Approach Rating: 5 out of 5 stars5/5iOS App Development For Dummies Rating: 0 out of 5 stars0 ratingsUML Demystified Rating: 0 out of 5 stars0 ratingsLearn to Code. Get a Job. The Ultimate Guide to Learning and Getting Hired as a Developer. Rating: 5 out of 5 stars5/5Ry's Git Tutorial Rating: 0 out of 5 stars0 ratingsOneNote: The Ultimate Guide on How to Use Microsoft OneNote for Getting Things Done Rating: 1 out of 5 stars1/5How Do I Do That in Photoshop?: The Quickest Ways to Do the Things You Want to Do, Right Now! Rating: 4 out of 5 stars4/5Learning R Programming Rating: 5 out of 5 stars5/5Good Code, Bad Code: Think like a software engineer Rating: 5 out of 5 stars5/5PYTHON: Practical Python Programming For Beginners & Experts With Hands-on Project Rating: 5 out of 5 stars5/5Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5JavaScript Application Design: A Build First Approach Rating: 0 out of 5 stars0 ratingsGit Essentials Rating: 4 out of 5 stars4/5Gray Hat Hacking the Ethical Hacker's Rating: 5 out of 5 stars5/5SQL For Dummies Rating: 0 out of 5 stars0 ratingsDebugging: The 9 Indispensable Rules for Finding Even the Most Elusive Software and Hardware Problems Rating: 4 out of 5 stars4/5Engineering Management for the Rest of Us Rating: 5 out of 5 stars5/5Android App Development For Dummies Rating: 0 out of 5 stars0 ratings
Reviews for Mastering Mobile Test Automation
0 ratings0 reviews
Book preview
Mastering Mobile Test Automation - Feroz Pearl Louis
Table of Contents
Mastering Mobile Test Automation
Credits
About the Authors
Acknowledgements
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Ensuring Five-star Rating in the MarketPlace
Introduction to mobile test automation
Mobile application packages
Native applications
Mobile web applications
Hybrid applications
Factors to be considered during mobile testing
Mobile automation testing approaches
Automation using real devices
Steps to set up automation
Limitations of this automation
Emulators-based automation
Steps to set up automation
Advantages
Limitations
User agent-simulation-based automation
Steps to set up the automation
Advantages
Limitations
Cloud-based automation
Steps to set up the automation
Advantages
Limitations
Types of mobile application tests
Selection of the best mobile testing approach
Troubleshooting and best practices
Summary
2. Designing Mobile Automation Frameworks
Selecting an automation tool
Types of mobile automation frameworks
The functional decomposition or test script modularity framework
Implementation required for mobile testing
The data-driven framework
Implementation required for mobile testing
The keyword-driven framework
Implementation required for mobile testing
The hybrid framework
Implementation required for mobile testing
Support libraries
Optimizing the combination of approach and framework
A robust reporting mechanism
The automation feasibility analysis
Test library management
Version control
Change control
Summary
3. User Agent – automating Mobile Applications with Browsers
Introduction
A user agent string
User agent simulation for mobile
User agent plugin programs
Setting up a mobile test automation lab for user agents
Setting up the user agent add-on for Mozilla Firefox
Setting up a user agent add-on for Google Chrome
Advantages of this approach
Limitations of this approach
The Hybrid framework implementation for the user agent
The UFT code snippet
The Selenium code snippet
Troubleshooting and best practices
Summary
4. Emulators and Simulators – the Automation of Emulated Devices
Introduction to mobile emulators
Setting up a mobile emulators for automation
The Android emulator setup
Automating the Android emulator with Selenium WebDriver
Code snippet
The iOS simulator setup
Code snippet
Implementing a mobile test automation framework for emulators
The Appium architecture
The Appium setup
Android on the Windows OS
Appium on the Mac OS
Scripting and execution with Appium
Scripting and object property extraction
Execution
Code snippet
Capabilities of the Android emulator for versions lower than 4.2 and hybrid applications
Advantages of mobile emulators
Limitations of mobile emulators
Troubleshooting and best practices
Summary
5. Automating Physical Devices
Getting started
Automation technologies with real devices
Automation with the optical recognition technology
Automation with AUT code instrumentation
Automating with native device methods
Object Identification with leading tools
Automation on real devices with various tools
Automation with Appium on real devices
Code snippet for Appium with real devices
Capabilities for Android devices with versions below 4.2
Automation with SeeTest on real devices
Configuring a SeeTest license
SeeTest tool configuration
Configuring a real mobile device for automation
Android devices
iOS-based devices
Windows-based devices
Blackberry devices
Instrumentation of a mobile application
Android platform
iOS platform
Windows platform
Blackberry platform
Mobile web applications
Creating scripts
Exporting scripts for integration with other execution environments
WebDriver code snippet
UFT code snippet
Advantages and limitations of this technique
Troubleshooting and best practices
Summary
6. Automating on Cloud
Getting started with cloud automation
Prominent mobile cloud automation tools
A private cloud lab setup
Integrating automation tools such as UFT and Selenium
Automation scripting with cloud devices
Automating with inbuilt cloud tool automation support
Test data parameterization
Interrupt scenario automation
Execution and reporting
Automating with third-party automation tools
Scripting with UFT
Scripting with Selenium
Troubleshooting and best practices
Summary
7. Optimizing Test Strategy and Estimation
Lifecycle of a mobile test automation project
Requirement gathering and analysis
Device matrix creation
Optimization of the device coverage matrix
Optimizing the test automation strategy
The automation feasibility analysis
Effort estimation
Return on investment
RoI calculation
The RoI analysis
Best practices to maximize the RoI
Automation framework design and development
Test scripting
Automation suite execution
The execution manager
Extensibility and maintenance
Some more best practices
Summary
8. Delivering Customer Delight
Customer delight – internal and external
An ideal mobile test automation framework
Mobile automation for agile projects
DevOps and shift left
Behavior-driven development
Continuous integration for mobile automation
Some sample mobile projects
Project 1 – an insurance provider's web application
Testing requirements
Optimization
The solution
Project 2 – automobile manufacturer's car dashboard and health-check application
Testing requirements
Optimization
The solution
Project 3 – using a web and hybrid application to enable BYOD for a secure banking application
Testing requirements
Optimization
The solution
Best practices
Summary
Index
Mastering Mobile Test Automation
Mastering Mobile Test Automation
Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: April 2015
Production reference: 1270415
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78217-542-1
www.packtpub.com
Credits
Authors
Feroz Pearl Louis
Gaurav Gupta
Reviewers
Karl Chavarria
Arik Lewin
Luis Lu
Commissioning Editor
Dipika Gaonkar
Acquisition Editor
Larissa Pinto
Content Development Editor
Siddhesh Salvi
Technical Editor
Abhishek R. Kotian
Copy Editors
Hiral Bhat
Aditya Nair
Sameen Siddiqui
Neha Vyas
Project Coordinator
Nidhi Joshi
Proofreader
Safis Editing
Indexer
Mariammal Chettiyar
Production Coordinator
Alwin Roy
Cover Work
Alwin Roy
About the Authors
Feroz Pearl Louis is an automation architect with over 10 years of extensive experience working with automation tools, such as HP UFT(formerly QTP), Selenium, SOAtest, SoapUI Pro, Cucumber, Watir, Ranorex, SeeTest, Perfecto Mobile, and Mobile Labs. His core expertise is in functional and mobile automation with traditional and nontraditional tools and techniques. He is currently working with the Automation Centre of Excellence of a Fortune 500 IT services company. He leads a team of 40 plus people spread across the entire spectrum of automation services, including functional, SOA, mobile, cross-browser and cross-platform automation, and Agile automation with behavior-driven development methodology. With his extensive design and development experience, he engages with various customer teams to design, implement, and deliver solutions that address their specific pain points. He is a prolific contributor to the automation community on various forums, such as LinkedIn, Quora and SQA Forums, and blogs at https://ferozlouis.blogspot.com.
Gaurav Gupta is a dynamic and young IT professional who is engaged in the testing of web and mobile applications. He has worked with various tools and techniques in the broad field of mobile testing. He has extensive experience in both web and mobile test suite design and optimizes various operating systems. He is a versatile tester and is always keen to learn new technologies to keep himself updated. His passion for work makes him stand out among others. Even at a relatively early stage of his career, he is the published author of the book Mastering HTML5 Forms. A graduate in Computer Science, he works with a reputed Fortune 500 IT services company. Gaurav is a native of Chandigarh, India, and currently lives in Pune, India.
Acknowledgements
First and foremost,I would like to thank my family—especially my mother—the guiding light of my life and my better half, Sadaf, whose constant support and encouragement made it possible for me to burn that midnight oil and brought me back from the verge of giving up. I would also like to thank my son, Haaris, who understood my need for long nights by the computer.I would like to specially thank my sister, Dinshaw, who has always been a constant support - Feroz Pearl Louis
First of all, I would like to thank the almighty and my family, who have always guided me to walk on the right path of life. My heartfelt gratitude and indebtedness goes to all those people in my life who gave me constructive criticism, as it contributed directly or indirectly in a significant way towards firing up my zeal to achieve my goals - Gaurav Gupta
We also gratefully acknowledge, with a deep sense of gratitude and most sincere appreciation, the timely support provided by Ashwarya Singh during the process of writing this book.
We wish to extend our sincere gratitude to the team from Packt Publishing and the technical reviewers for their valuable suggestions, which proved extremely helpful in making this a better book for you.
Our special thanks to our mentors, colleagues,and friends for sharing their mobile testing experiences, which have proved very valuable in making this book better oriented toward the real-world challenges faced in mobile testing projects.
About the Reviewers
Karl Chavarria, LFCE, is a software engineer in test currently working for LivingSocial and is also an avid technology hobbyist. For the past 7 years, Karl has lived in the Portland metro area, where he has worked at various tech start-ups and studied Computer Science at Portland State University. Karl started his career in Linux system administration, but soon steered toward quality assurance after seeing just how much it incorporated one of his favorite tasks: automation. When he's not increasing the efficiency of his Ruby code, Karl can be found working on programming-side projects, playing music arcade games, and enjoying all of the delicious food that the Pacific Northwest has to offer.
Arik Lewin has many years of experience in the software development of changing environments and technologies with server-side and client-side orientation. He has participated in many successful start-ups and enterprise large-scale projects as a key player, expert developer, innovator, and architect. Over the years, he acquired unique skills from the web tier by creating mobile and desktop applications. He has worked with frameworks from Java to, the most popular, JavaScript.
Over the past few years, Arik has joined HP Mercury, participated in making test automation products, and initiated his own open source project automation framework for mobile web named CATJS. He attended many related events as a speaker and participated in promoting the new agile methodology and approach for mobile web testing.
Arik helped a lot of development groups to make versatile challenges and still shares his vast knowledge with others.
Luis Lu is a testing architect and inventor at SAP Labs, China. He has solid technology experience in quality assurance, web/mobile test automation, performance, security, continuous integration, and so on. He is an open source fan and likes to play around with new technology. You can reach him directly at his GitHub website https://github.com/luisxiaomai or e-mail him at
www.PacktPub.com
Support files, eBooks, discount offers, and more
For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.
Why subscribe?
Fully searchable across every book published by Packt
Copy and paste, print, and bookmark content
On demand and accessible via a web browser
Free access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view 9 entirely free books. Simply use your login credentials for immediate access.
Preface
This book will guide you to develop an in-depth understanding of mobile automation concepts and techniques to design, implement, and deliver customized mobile automation solutions with real, emulated devices and cloud-based mobile testing tools, such as Perfecto Mobile, and Mobile Labs, integrated with traditional tools, such as UFT and Selenium, and other leading tools in the market, such as ExperiTest SeeTest.
This book is a comprehensive reference guide to every aspect of mobile test automation and can be used in any organization that is engaged in test automation and /or takes up mobile test automation.
What this book covers
Chapter 1, Ensuring Five-star Rating in the MarketPlace, explains how mobile test automation is different from traditional functional automation and what the typical challenges are that you have to overcome. This chapter provides you with a brief overview of the different techniques used for mobile automation. These techniques are elaborated in later sections of the chapter. This section explains why and how there are different techniques.
Chapter 2, Designing Mobile Automation Frameworks, explains the various types of automation frameworks with respect to mobile automation, such as functional decomposition, keyword-driven, data-driven, and hybrid, with a focus on mobile-specific differences. This has real examples of working code for various tools.
Chapter 3, User Agent – automating Mobile Applications with Browsers, provides you with the opportunity to learn the use of the user-agent technique, along with the code snippets and lab setup for this technique. We will also delve into the advantages and disadvantages of this technique.
Chapter 4, Emulators and Simulators – the Automation of Emulated Devices, explains the use of emulators and simulators for mobile test automation, along with the code snippets and lab setup for this technique. We will also delve into the advantages and disadvantages of this technique.
Chapter 5, Automating Physical Devices, showcases the techniques required to automate a mobile application with physically present real mobile devices.
Chapter 6, Automating on Cloud, provides you with the opportunity to learn the techniques required to automate a mobile application with cloud tools such as Perfecto Mobile and Mobile Labs.
Chapter 7, Optimizing Test Strategy and Estimation, deals with the selection of the most suitable strategy to focus on maximizing the return on investment for automation and the ways to avoid any potential pitfalls. We will also look at the various technical aspects that are usually overlooked and only become apparent at the end of a delivery cycle. This chapter deals with how to estimate your mobile automation effort.
Chapter 8, Delivering Customer Delight, sums up all the lessons learnt in the previous chapters and covers the test strategy planning, project effort optimization, ways to maintain the automation suite, resource identification, and the management of hardware and software.
What you need for this book
A familiarity with functional automation testing would help, but it is not a prerequisite as all concepts are explained in a detailed manner in this book. To work with the examples practically, you need to use any given tool for mobile test automation such as:
Selenium (WebDriver 2.0 with Android and iOS Driver)
Appium
HP UFT 12.00 or a later version
Perfecto Mobile
ExperiTest SeeTest
Who this book is for
The core audiences are mobile application developers, QAs, project managers, and automation and manual testers who are beginning to learn or are working on any mobile testing assignment.
Conventions
In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: The keywords array contains the list of all keywords for a particular test case denoted by a row in the BusinessFlow excel file.
A block of code is set as follows:
'Test Script 1: To validate that application Login is allowed with valid credentials
'Open EMail
fn_gotoTestingEMailAccount();
'Enter the details
fn_EnterDetails();
'Submit
fn_SubmitToCreate();
New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: After installation of Firefox User Agent add-on from the add-on market, it is accessible from Tools menu.
Note
Warnings or important notes appear in a box like this.
Tip
Tips and tricks appear like this.
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.
To send us general feedback, simply e-mail <feedback@packtpub.com>, and mention the book's title in the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
Downloading the example code
You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.
To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.
Piracy
Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name