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