Practical Desktop App Test Automation with Appium
$15.00
Minimum price
$25.00
Suggested price

Practical Desktop App Test Automation with Appium

Test Windows desktop apps wisely with Appium

About the Book

While few people deny the benefits of test automation, comprehensive automated testing via UI (browser for web applications) is rarely implemented in software projects. Common reasons for projects' failed attempts on test automation are:

  • Difficult to learn - test scripts are complex and testing tools are not easy to use
  • Hard to maintain - UI tests are vulnerable to application changes
  • Long feedback loop - automated tests take too long to run

To succeed in automated testing via UI, software projects need to overcome all these 3 challenges.

This book presents a practical approach to implementing test automation for desktop applications. Topics include:

  • Developing easy to read and maintain Appium tests using a next-generation functional testing tool
  • Page object model
  • Functional Testing Refactorings
  • Setting up a continuous testing server to manage the execution of a large number of automated UI tests

To help readers learn more effectively, the book has a dedicated site containing the following resources:

  • Software. Test automation is not necessarily expensive. All test frameworks featured in this book are free and open-source.
  • Sample test scripts. Ready-to-run test scripts for the exercises in the book.
  • Tutorial screencasts. You will be able to see how exercises are done step by step.

About the Editors

Zhimin Zhan
Zhimin Zhan

Zhimin Zhan is the founder and principal agile testing coach of AgileWay Pty Ltd, Australia. As an advisor and coach, he helps organizations by implementing test automation with Continuous Testing using open technologies such as Selenium WebDriver and RSpec. Zhimin is the creator of TestWise, the next-generation functional testing tool that supports functional test refactorings, and BuildWise, an award-winning Continuous Testing Server. Zhimin is a frequent speaker and author of 11 books on software testing and programming. He shares his test automation and CI experience on Medium.

Table of Contents

  • Preface
    • Who should read this book
    • How to read this book
    • Send me feedback
  • 1 Introduction
    • 1.1 Test automation benefits
    • 1.2 Test Automation success factors
    • 1.3 Why traditional commercial testing tools all failed?
    • 1.4 Choose a right automation framework
    • 1.5 Appium + WinAppDriver is the solution, period
    • 1.6 Synergy of web app and native app testing
    • 1.7 Desktop App Automation is harder than Web’s
    • 1.8 Challenges with Appium + WinAppDriver
    • 1.9 Next action
  • 2 First Appium Automation Script
    • 2.1 Appium’s Client-Server Architecture
    • 2.2 Set up Appium Server with WinAppDriver
      • Install and start Appium server
      • WinAppDriver
      • Enable Developer mode on Windows 10
    • 2.3 Set up Appium Client
      • Ruby
      • Ruby Library for Appium - appium_lib
    • 2.4 First Appium Desktop App Test
      • Open ‘Calculator’ App
      • Drive controls on the app
    • 2.5 Control Inspector
    • 2.6 Test Tools
      • TestWise IDE
      • Visual Studio Code
  • 3 Test Syntax Framework
    • 3.1 RSpec Framework
    • 3.2 Transform automation scripts to test scripts
      • Put it into a structure
      • Use RSpec hooks
      • Add Assertions
      • Add one more test case
    • 3.3 Run RSpec tests
      • Run RSpec test script file from the command line
      • Run a specific test case from the command line
      • Run RSpec tests in TestWise
      • Run RSpec tests in Visual Studio Code
    • 3.4 Alternative test syntax frameworks
  • 4 Find App Window
    • 4.1 A closer look at the script
    • 4.2 Launch UWP App by AppId
    • 4.3 Launch Classic App by executable
    • 4.4 Launch app with arguments
    • 4.5 Find existing App Window
  • 5 Locators
    • 5.1 Tools to identify UI elements
      • WinAppDriver UI Recorder
      • Accessibility Insights
      • Inspect.exe
      • Page Source
    • 5.2 Appium’s six locators
      • Accessibility Id
      • Name
      • XPath
      • Tips on simplifying XPath
      • Class Name
      • ID
    • 5.3 Chain find_element to find child elements
    • 5.4 Guide on selecting locator?
    • 5.5 Advice on performance
      • Which locator is faster?
      • Limit the scope
    • 5.6 Find multiple elements
  • 6 Getting started
    • 6.1 An End-To-End Notepad scenario
      • Start Notepad and type some text
      • Find the main window
      • Send Keys to the main window
      • Send keys to an editor control
      • Click a menu item
      • Drive popup window
      • Close the app
    • 6.2 Calculator
      • Get Window’s title
      • Get Appium server info
      • Get an element’s location on the page or screen
      • Get an element’s size in pixels
      • Get an element’s dimensions and coordinates
      • Get an element’s attribute
  • 7 Keyboard and Mouse
    • 7.1 Keyboard
      • Type non-visible characters
      • Clear
      • Type special keys
      • Select menu item by key combinations
      • Select menu item by keyboard shortcut
    • 7.2 Mouse
      • Click a menu
      • Click a button on the toolbar
      • Double Click
      • Context Click
    • 7.3 Advanced User Interactions
      • Double Click
      • Move window
      • Context click
      • Drag and drop
      • Click by offset
  • 8 Assertion
    • 8.1 Assert Window title
    • 8.2 Assert Text in an Edit control
    • 8.3 Assert a control’s attributes
    • 8.4 Assert text present
    • 8.5 Assert CheckBox is checked
    • 8.6 Assert not …
    • 8.7 Assert RadioButton is checked
    • 8.8 Assert Disabled
    • 8.9 Assert ComboBox option
    • 8.10 Check equal of two elements
  • 9 Review
    • 9.1 Syntax errors
      • How to avoid syntax errors?
    • 9.2 Set up source control
      • Git Installation
      • Set up Git for local working folder
      • Set up Git for a shared folder on a network drive
      • Frequently used Git commands after set up
    • 9.3 GUI/Object map
    • 9.4 Custom libraries
    • 9.5 Debugging
    • 9.6 What is the best learning method?
  • 10 Test Maintenance
    • 10.1 Linear test steps are hard to maintain
    • 10.2 Maintainable automated test design
      • Intuitive to read
      • Reusable function
      • Page Object Model
      • When to use Reusable Functions or Page Objects?
    • 10.3 Don’t Repeat Yourself
      • DRY with Reusable Functions
      • DRY with Page Objects
    • 10.4 Maintain with ease
    • 10.5 Wrap Up
  • 11 Improve Efficiency
    • 11.1 Simple project structure
    • 11.2 Test execution
      • Run test cases in a test script file (F10)
      • Run individual test case (Shift+F10)
    • 11.3 Quick navigation
      • Go to Test Script File (Ctrl+T)
      • Go to Test Case (Ctrl+Shift+T)
    • 11.4 Fast Editing with Snippets
    • 11.5 Script library
    • 11.6 Test refactoring
    • 11.7 Debug test scripts
      • Keep the app window open
      • Attach test execution to an existing window
    • 11.8 Wrap up
  • 12 Functional Test Refactoring
    • 12.1 Functional test refactoring
      • Functional test refactoring goals
    • 12.2 Tool support
    • 12.3 Case study
      • Extract Function
      • Move to Helper
      • Move
      • Extract to Page Function
      • Introduce Page Object
      • Rename
    • 12.4 Wrap up
  • 13 Test Data
    • 13.1 Test data needs to be reusable
    • 13.2 Generate Test Data on the fly
      • Get date dynamically
      • Intuitive date utility by ActiveSupport
      • Get a random boolean value
      • Generate a number
      • Get a random string at a fixed length
      • Get a random string in a collection
      • Generate random person names, emails, addresses
      • Generate a test file at fixed sizes
    • 13.3 Retrieve data from Database
    • 13.4 Reset database
  • 14 Case Study: Test TestWise
    • 14.1 Launch App cleanly
    • 14.2 App Version
    • 14.3 Custom execution with Environment Variables
    • 14.4 Common UI elements
      • ToolBar
      • Checkbox
      • Tab
      • HyperLink
      • Text Edit Controls
      • Button
    • 14.5 Launch App with Argument
    • 14.6 Reusable Test Data
    • 14.7 Open a specific test file
    • 14.8 Test Automation Support in App
    • 14.9 Context Click
    • 14.10 Drag and drop
    • 14.11 Verify a file moved
    • 14.12 Wrap up
  • 15 Continuous Testing
    • 15.1 CT Overview
    • 15.2 Prerequisite
      • Test Scripts are source controlled in Git
      • The CT server is up running
      • Appium set up on build machines
      • Build Agents on build machines are up running
    • 15.3 Continuous Testing Steps
      • Trigger a build on the server via web interface
      • Build Agent preparation
      • Parallel Test Execution with Build Agents
    • 15.4 Parallel Testing Lab
    • 15.5 Ongoing maintenance
    • 15.6 Test Stats or Reports
  • 16 Appium in other languages
    • 16.1 Appium with Python
      • Install Appium Python Client
      • First Python Appium Script
      • First Python Appium Test
    • 16.2 Appium with C#
      • Install Appium C# Client Library
      • First C# Appium Script
      • First C# Appium Test
    • 16.3 Wrap up
  • Resources
    • Books
    • Web Sites
    • Tools
  • References

The Leanpub 60-day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

Do Well. Do Good.

Authors have earned$11,234,590writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF, EPUB and/or MOBI files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub