Appium Essentials - Manoj Hans - E-Book

Appium Essentials E-Book

Manoj Hans

0,0
23,99 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

This book is intended for automation testers and developers who want to enhance their skills from web-based automation to mobile application automation using Appium. Basic knowledge of mobile application testing, Selenium WebDriver, and programming is assumed.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 144

Veröffentlichungsjahr: 2015

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

Appium Essentials
Credits
About the Author
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. Appium – Important Conceptual Background
Appium architecture
Appium on iOS
Appium on Android
The Selenium JSON wire protocol
Appium session
Desired capabilities
Android capabilities
iOS capabilities
The Appium server and its client libraries
Summary
2. Getting Started with Appium
Appium – pros and cons
System requirements for Android/iOS
Android requirements on Windows and Mac
iOS requirements
Installing different software
Appium installation for Android
Installing JDK on Windows
Installing the Android SDK
Setting the system variables for Mac
Appium for iOS
Installing Xcode
Installing Homebrew
Node and npm
Appium for different OSes
Appium for Windows
Appium for Mac
Downloading the necessary JAR files
Creating emulators and simulators
An iOS simulator
An Android emulator
Setting up an Eclipse Java project
Summary
3. The Appium GUI
The Appium server
The Appium GUI for Windows
Android Settings
Application
Launch Device
Capabilities
Advanced
General Settings
Server
Logging
Developer settings
About
Inspector
The Launch/Stop button
The Clear button
The Appium GUI for Mac
Android Settings
iOS Settings
Application
Device Settings
Advanced
Robot Settings
Save/Open configuration
Appium doctor
Inspector
The Recording panel
Summary
4. Finding Elements with Different Locators
Finding elements for Android web-based apps using the Chrome ADB plugin
Finding elements for iOS web-based apps using Safari's Develop option
Finding elements by ID
Finding elements by name
Finding elements by linkText
Finding elements by Xpath
Finding elements by cssSelector
Finding elements for native and hybrid apps
Finding elements with UIAutomatorviewer
Finding elements by ID
Finding elements by name
Finding elements by className
Finding elements by AccessibilityId
Finding elements by AndroidUIAutomator
Finding elements with Appium Inspector
Finding elements by Xpath
Finding elements by name
Finding elements by IosUIAutomation
Summary
5. Working with Appium
Important initial points
Necessary desired capabilities for Android and initiating the Android driver
Desired capabilities for native and hybrid apps
Desired capabilities for web apps
Necessary desired capabilities for iOS and initiating the iOS driver
Desired capabilities for native and hybrid apps
Desired capabilities for web apps
Automating native apps
Native Android apps
Native iOS apps
Working with web-apps
Web apps on Android
Web apps on iOS
Hybrid apps' automation
Android hybrid apps
iOS hybrid apps
Summary
6. Driving Appium on Real Devices
Important initial points
Desired capabilities for Android and initiating the Android driver
Desired capabilities for native and hybrid apps
Desired capabilities for web apps
Installing provisional profile, SafariLauncher, and ios-webkit-debug-proxy
Provisional profile
SafariLauncher app and ios-webkit-debug-proxy
Desired capabilities for iOS and initiating theiOS driver
Desired capabilities for native and hybrid Apps
Desired capabilities for web apps
Automating native apps
Android native apps
iOS native apps
Working with web apps
Web apps on Android
Web apps on iOS
Automating hybrid apps
Android hybrid apps
iOS hybrid apps
Summary
7. Advanced User Interactions
Exploring advanced user interactions
Long press
Scroll and swipe
Drag and drop
Pinch and zoom
Alerts
Spinners
The switch button
The slide SeekBar
Capturing screenshots
Capturing screenshots on test failure
Summary
Index

Appium Essentials

Appium Essentials

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 author, 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: 1060415

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham B3 2PB, UK.

ISBN 978-1-78439-248-2

www.packtpub.com

Credits

Author

Manoj Hans

Reviewers

Shankar Garg

Petro Podrezo

Yalçın Yenigün

Commissioning Editor

Amit Ghodake

Acquisition Editor

Reshma Raman

Content Development Editor

Ritika Singh

Technical Editor

Manan Patel

Copy Editor

Dipti Kapadia

Project Coordinator

Aboli Ambardekar

Judie Jose

Proofreaders

Simran Bhogal

Lesley Harrison

Indexer

Priya Sane

Production Coordinator

Komal Ramchandani

Cover Work

Komal Ramchandani

About the Author

Manoj Hans is a senior QA engineer who has rich experience in software testing. Apart from testing, he has worked in other areas of IT such as web hosting, development, and software configuration.

He was interviewed for the September 2013 edition of Software Developer's JOURNAL magazine for Selenium training in India. Manoj is passionate about automation testing and loves to automate things.

I would like to thank my family for their continued support while I spent evenings and weekends on the computer. I also want to thank Ujjawal Kumar, Nishank Jangra, and the Packt Publishing team for their support during the writing of this book.

About the Reviewers

Shankar Garg is an agile enthusiast, with expertise in automation testing. Currently, he works as a senior consultant with Xebia IT Architects India Pvt. Ltd.

He started his career as a Java developer, but his love for breaking things got him into testing. He has worked on the automation of many projects for web, mobile, and SOA technologies. Right now, he is in love with Cucumber, Selenium, Appium, and Groovy.

Prior to working with Xebia, he has worked for Jabong.com, Honeywell, and Tata Consultancy Services (TCS).

He is a Certified ScrumMaster (CSM), certified tester (ISTQB), as well as a certified programmer for Java (SCJP 5.0) and Oracle9i (OCA).

I would like to thank my family for supporting me when I was reviewing this book and making sure that I completed things on time.

Petro Podrezo is a software consultant from Toronto, Canada. He holds an HBSc degree from the University of Toronto in computer science and has specialized in software engineering. His work is mostly based on web development, but occasionally, it stretches into the realm of mobile applications development. Apart from work, Petro enjoys contributing to various open source projects and developing web apps as side projects.

Yalçın Yenigün has been working in the IT industry since 2009. He earned his bachelor's degree in computer engineering from the University of Galatasaray, Istanbul. He has experience in object-oriented design, analysis, agile, test-driven development, and Java/J2EE, in the full life cycle of the software design process. He has worked for ZeroBuffer and Vodafone as a software engineer and implemented various large-scale projects.

Yalçın currently works as a software development unit manager in BilgeAdam, where he is responsible for people management, for a division of more than 10 software engineers. He is a trainer of Java programming, Effective Java programming, Java Enterprise Edition, Java Web Services, Android programming, and the Professional SCRUM Developer courses for corporates. He has been sponsored by The Scientific and Technological Research Council of Turkey for open source research projects as well.

I would like to thank my friend, Abdullah Aydeğer; my mathematician brother, Orçun Yenigün; and my best friend, Cansın Aldanmaz, for their support throughout the reviewing of this book. I also owe thanks to my father, Ünal Yenigün, and mother, Hanife Yenigün, for their unconditional love.

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 <[email protected]> for more details.

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 PacktCopy and paste, print, and bookmark contentOn 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

The idea of mobile automation using the Selenium syntax first came about at the Selenium Conference in April 2012 in London by Dan Cuellar. During the presentation, he showed the automation of iOS using the Selenium syntax. People who attended the conference were excited about the tool's possibilities.

A few months after the Selenium conference, Jason Huggins contacted Dan about his project on mobile automation. Jason encouraged Dan to release his code under an open source license. In August that year, Dan released the source code on GitHub. Jason then decided to introduce the project in Mobile Testing Summit in November 2012, but the project needed a new name first. Thus, the name Appium was born.

Appium is the one of the most popular tools for mobile automation and is used for testing applications on iOS, Android, and Firefox platforms. It can automate native, hybrid, and web mobile apps.

In January 2013, Sauce Labs decided to fully back Appium and created a team to support Appium. The team, which included Jonathan Lipps (the current project lead), decided that Appium needed a rebirth and ultimately settled on Node.js as the framework to be used.

Appium, with its new design, debuted in Google Test Automation Conference 2013 and was released with Android and Selendroid support a few months later, to make Appium the first cross-platform automation framework. In May 2014, Appium released version 1.0 with stability improvements, bug fixes, and added features. If you want to read more about Appium's history then you can visit the official website http://appium.io/history.html.

This book will help you perform mobile automation testing and use Appium drives on both emulators/simulators and real devices. You will also have a good understanding of mobile automation concepts once you're through with it.

What this book covers

Chapter 1, Appium – Important Conceptual Background, explains the JSON wire protocol and Appium sessions, and you will get to know the "desired capabilities" that are required before you start using Appium. A brief introduction to the Appium server and the client library are also provided in the chapter.

Chapter 2, Getting Started with Appium, explains the system requirements for both Android and iOS platforms and the advantages of using Appium over other existing tools. You will also understand the prerequisites to get started with Appium. In this chapter, you will learn how to install and set up the software with system variables and create the development environment.

Chapter 3, TheAppium GUI, explains all the functionalities of the buttons and general settings using the Appium GUI.

Chapter 4, Finding Elements with Different Locators, explains the steps to find elements in order to interact with mobile applications. You will also be acquainted with how to use different locators and techniques to find the elements.

Chapter 5, Working with Appium, explains scriptwriting for different mobile applications that are supported by Appium. You also get to know about how to install mobile apps in an emulator.

Chapter 6, Driving Appium on Real Devices, introduces users to testing mobile applications on real devices. This chapter also includes the general settings required for real devices to work with Appium.

Chapter 7, Advanced User Interactions, explores the Appium client library and mobile gestures, such as scroll, zoom, and swipe. You will also learn how to capture screenshots and the uses of the TestNG Listener for taking screenshots on test failure.

What you need for this book

You will need the following software to get started with the examples in this book:

Java (version 7 or later)The Android SDK API Version 17 or laterThe Eclipse IDETestNGThe Appium ServerThe Appium client library (Java)The Selenium Server and WebDriver Java libraryThe ADB plugin on Chrome browserWindows 7 or laterMac OS 10.7 or laterXcode (4.6.3 or a later version; 5.1 is recommended)

Who this book is for

Appium Essentials is intended for automation testers and developers who want to enhance their skills in web-based automation as well as mobile application automation using Appium. It is assumed that you have basic knowledge of mobile application testing, Selenium WebDriver, and programming.

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 <[email protected]>, 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 immediately so that we can pursue a remedy.

Please contact us at <[email protected]> with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at <[email protected]>, and we will do our best to address the problem.

Chapter 1. Appium – Important Conceptual Background

In this chapter, we will learn about the Appium architecture, JavaScript Object Notation (JSON) wire protocol, and Appium sessions as well as gain an understanding of the