Search GimmeJob

Type at least 2 characters. Enter also searches by meaning.
GimmeJob
Sign in
Test automation · Desktop Automation Example · Chapter 01 / 04

Test automation learning path

Desktop Automation Example: Overview

Build the desktop-automation mental model first: execution lifecycle, Windows UI Automation, repository layers and how the two implementations correspond.

Desktop automation through one real project

This example is not a collection of unrelated code snippets. It is a guided study of one Windows desktop automation repository. The objective is to understand how an automated desktop test is built from the operating-system boundary upward: a test runner creates test state, launches a real application, discovers UI Automation elements, performs user-like actions, verifies both UI state and persisted data, cleans up its resources, and publishes evidence.

The execution model

pytest / NUnit
      ↓
test setup and unique temporary file
      ↓
launch Notepad
      ↓
Windows UI Automation tree
      ↓
locate window → tab → editor
      ↓
input and synchronization
      ↓
UI assertion + saved-file assertion
      ↓
screenshots / Allure evidence
      ↓
cleanup

The repository implements the same desktop problem in two stacks: Python + pytest + pywinauto and C# + NUnit + FlaUI/UIA3. Studying both is useful because the syntax changes while the automation concepts remain the same. The final part moves the same tests into local PowerShell orchestration and GitHub Actions, where desktop automation adds an important constraint: tests need a Windows environment capable of interacting with a real graphical session.

Start from the execution map, not from syntax

Build the mental model of the repository before opening individual helpers.

Concept

Without this map, helper functions look unrelated. The useful unit of understanding is the execution chain: runner → setup → application launch → UI Automation discovery → interaction → assertion → cleanup → reporting.

Code from the project

Reviewed source: `README.md`


desktop-automation-lab/
├── flaui/Notepad.Tests/
├── python/tests/test_notepad.py
├── scripts/run-local.ps1
└── .github/workflows/desktop-ui-tests.yml

Detailed explanation

The repository has four execution layers. Test scenario code lives in Python and C#. run-local.ps1 orchestrates both stacks on a developer machine. desktop-ui-tests.yml recreates the environment on a GitHub-hosted Windows runner, runs the suites, combines their Allure results and publishes artifacts/report output.

Initially, a repository containing files. Once this step completes, a model of which layer owns test intent, framework mechanics, local orchestration and CI orchestration.

Design reasoning

If you learn files in isolation, it becomes easy to confuse framework code with test behavior or to treat CI commands as unrelated shell syntax.

Key points

  • Trace ownership across layers.
  • The same Notepad behavior is intentionally implemented in two stacks.

Common pitfalls

  • Opening the largest base-class file first and trying to memorize it top-to-bottom.

Source registry

10 chapter references
Desktop Automation Lab — reviewed commit

Exact source code used by every project-walkthrough lesson

sergiiiavt · Reference implementation
Source ↗
UI Automation Overview

Windows UI Automation tree, elements, control types, properties and patterns

Microsoft Learn · Official documentation
Source ↗
pywinauto documentation

Python Windows GUI automation, UIA backend and wrappers

pywinauto · Official documentation
Source ↗
pytest fixtures reference

Fixture injection, yield values and teardown semantics

pytest · Official documentation
Source ↗
FlaUI

FlaUI architecture, UIA2/UIA3 backends and Windows automation elements

FlaUI · Official repository
Source ↗
NUnit SetUp and TearDown

Per-test setup/teardown lifecycle and inheritance behavior

NUnit · Official documentation
Source ↗
Workflow syntax for GitHub Actions

Triggers, jobs, runners, steps, actions and conditions

GitHub Docs · Official documentation
Source ↗
Contexts reference

github, runner, secrets and variables contexts used by the CI workflow

GitHub Docs · Official documentation
Source ↗
Allure Report — Pytest

pytest result generation, attachments and Allure report workflow

Allure Report · Official documentation
Source ↗
Allure Report — NUnit

NUnit integration, result directory, metadata and attachments

Allure Report · Official documentation
Source ↗