Test Automation for Windows Apps with WinAppDriver and Python
4 Days
pythonwin32uwpwpf
testingAutomation
Intermediate
testerdeveloper

This workshop coaches participants on how to automate Windows desktop application testing using WinAppDriver (and Appium), which is Microsoft's implementation of the WebDriver protocol for Windows applications. With minimal presumption on participant's knowledge, the workshop commences with Python fundamentals and pytest basics, then moves to WinAppDriver usage as a tool for test automation of native Windows applications. The course covers testing of Win32, UWP, and WPF applications with comprehensive coverage of element interactions, window management, and advanced automation patterns. The course covers everything from Python basics to advanced automation patterns including Page Object Model, data-driven testing, error handling, and production-ready test frameworks. Participants will gain comprehensive hands-on experience with all WinAppDriver capabilities including all locator strategies, touch actions, and production framework patterns. Highlight of this workshop is extensive demos with hands-on exercises and real-world production framework patterns.

Audience

Participants must be testers or developers who aspire to use WinAppDriver to efficiently automate Windows desktop applications.

Prerequisites

Participant should have basic coding literacy and willingness to learn Python.

Topics

Foundation
  • Python Essentials
    • Variables, Data Types, and Strings
    • Collections: Lists, Dictionaries, Tuples
    • Control Flow: if/elif/else, for/while loops
    • Functions and Error Handling
    • Classes and Objects basics
    • Modules and Imports
    • Python Idioms for Test Automation
  • pytest Framework
    • Test Structure and Conventions
    • Running Tests and Command-line Options
    • Assertions and Test Outcomes
    • Parametrization for Data-Driven Tests
    • Markers and Test Organization
    • Fixtures: Function, Class, Module, Session Scopes
    • conftest.py and Shared Fixtures
    • Test Classes and Setup/Teardown
  • WebDriver Architecture
    • Timeout configurations
    • implicit, explicit, script timeouts
    • Client-Server Model
    • HTTP/JSON Wire protocol
    • Appium Overview and WinAppDriver
    • Desired Capabilities
    • Session Management
WinAppDriver Fundamentals
  • Element Locator Strategies
    • Accessibility ID (AutomationId)
    • Name Attribute
    • XPath
    • Class Name and Tag Name
    • ID and CSS Selector
    • Limitations
    • Locator Strategy Decision Tree
    • Using Accessibility Insights tool
  • Session and Application Lifecycle
    • Creating New Sessions
    • Attaching to Existing Windows
    • Multiple Concurrent Sessions
    • Application Launch with Arguments
    • Graceful Close vs Force Terminate
  • Wait Strategies and Timeouts
    • Implicit Wait
    • Explicit Wait
    • Expected Conditions
    • WebDriverWait
    • Custom Conditions
    • Timeouts
    • Best Practices
  • Element Interactions
    • Mouse Actions
      • Click, Double-Click, Right-Click
      • Drag and Drop, Hover
    • Keyboard Actions
      • send_keys, Special Keys
    • Modifier Keys
      • Ctrl, Shift, Alt, Windows
    • Touch Actions
      • Tap, Swipe, Long Press, Multi-Touch
    • Action Chains for Complex Interactions
    • Test Structure and Conventions
    • Running Tests and Command-line Options
    • Reading Element Properties and State
Advanced Automation
  • Window Management
    • Window Handles and Enumeration
    • Switching Between Multiple Windows
    • Window Sizing and Positioning
    • Maximize, Minimize, Fullscreen
    • Modal Dialogs and Alerts
    • Window Focus and Activation
    • Multi-Monitor Considerations
  • Page Object Model Pattern
    • Benefits and Design Principles
    • BasePage Class implementation
    • Element Locators as Class Attributes
    • Method Chaining and Fluent Interfaces
    • Client-Server Model
    • Separating Test Logic from Page Logic
    • Reusable Page Objects
  • HTTP/JSON Wire Protocol
    • Appium Overview and WinAppDriver
    • JSON Configuration Files
    • Desired Capabilities
  • UWP App Connection Challenges
    • Element Staleness handling
    • Display Text Format Parsing
    • Button Click Timing issues
  • Building Complete Test Scenarios
Production Framework
  • Framework Architecture
    • Project Structure and Organization
    • Configuration Management
    • Utilities and Helper Modules
    • Custom Assertions
    • Screenshot Capture Strategies
    • Logging and Debugging
  • Error Handling and Retry Logic
    • Try-Except Patterns
    • Retry Decorators
    • Stale Element Recovery
    • Connection Failure Handling
    • Graceful Degradation
  • WinAppDriver Guidelines and Pitfalls
    • Session and Application Lifecycle
    • API Limitations and Workarounds
    • is_displayed()
    • get_attribute()
    • Timing and Synchronization Issues
    • Cross-Application Testing
    • Multiple Concurrent Sessions
    • Performance Optimization
    • HTML Reports with pytest-html
    • Screenshot Attachments
    • Best Practices for Reliable Tests

Exclusions

Python programming beyond test automation needs, Web application testing with Selenium, Web/Mobile application testing (iOS/Android), Performance and load testing, Advanced distributed testing frameworks

Anything not mentioned in Topics

Software Requirements

Python
PyCharm/Visual Code for Python
WinAppDriver
Accessibility Insights

Internet Requirements

Good unrestricted internet connection is required.

Hardware Requirements

Laptop capable to run MS Office

Classroom Requirements

Projector with HDMI, White Board, Markers with Eraser

Online Requirements

Appropriate meeting software e.g. Zoom, MS Teams Please make sure that camera, speaker and mic are working

If you have any query, please contact now.