skillfed

uiautomation

Python UIAutomation for Windows

uiautomation v2.0.29 289.4K downloads/30d#8,001 on PyPI3,550
Permissive license Apache 2.0 Active released

What it is and what it does

uiautomation is a Python wrapper around the Microsoft UIAutomation API for Windows, allowing developers to programmatically find, inspect, and interact with UI controls in Windows applications. It works with applications that implement UIAutomation providers—including MFC, Windows Forms, WPF, Modern UI, Qt (partially), Firefox, Chrome, and Electron-based apps—enabling automated testing, control manipulation, and UI traversal.

The package provides a control tree model where you search for UI elements by their properties (name, control type, depth) and then interact with them via patterns (value, invoke, etc.). It includes a command-line tool (automation.py) for exploring the control hierarchy and a Python API for scripting. The main constraint is that it requires administrator privileges on Windows 7 and higher, and certain Python versions (3.7.6, 3.8.1) are incompatible due to comtypes issues.

Use it for:

  • Automated testing of Windows desktop applications by simulating user interactions like clicks, text input, and menu navigation
  • Building test automation frameworks that verify UI behavior across MFC, WPF, and Windows Forms applications
  • Creating accessibility inspection tools to audit UI control properties and supported interaction patterns
  • Scripting repetitive UI tasks in legacy Windows applications that lack APIs or command-line interfaces
  • Automating data entry workflows across multiple Windows applications by chaining control searches and interactions

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Automates Windows UI controls and windows by interacting with the Microsoft UIAutomation API, enabling programmatic inspection and manipulation of application interfaces.

Yes, if you need to automate Windows UI testing or control interaction. The package is actively maintained, has low install friction, and covers a broad range of Windows application types. Install only on Windows 7 or later, run as administrator, and avoid Python 3.7.6 and 3.8.1. No known security vulnerabilities.

Install

uiautomation on PyPI

pip

pip install uiautomation

uv

uv add uiautomation

poetry

poetry add uiautomation

Installing uiautomation

Before you install

Low install friction with a single runtime dependency (comtypes). Actively maintained with recent commits and a substantial user base. Note: avoid Python 3.7.6 and 3.8.1 due to comtypes incompatibility; use an earlier or later version instead.

License in practice

Apache 2.0 permissive license allows free copying, distribution, and use with minimal restrictions, making it suitable for both open-source and proprietary projects.

Quickstart

pip install uiautomation

import uiautomation as auto

# Find and interact with a window
window = auto.WindowControl(searchDepth=1, ClassName='Notepad')
edit = window.EditControl()
edit.SendKeys('Hello World')

Must run Python as administrator on Windows 7 or higher; otherwise control enumeration and information retrieval may fail. Windows 7 or later required.

Verify before relying

  • Whether partial Qt support covers the specific Qt versions or frameworks in use
  • Whether Electron apps require the --force-renderer-accessibility flag to be set externally or if the package handles it
  • Performance characteristics when traversing large control trees with many nested controls

Package facts

License Apache 2.0 (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — comtypes
Maintenance actively maintained — 374 days since the last release
Last repo commit
First released
Downloads 289,377/month — #8,001 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: uiautomation-2.0.29-py3-none-any.whl

Keywords: windows, ui, automation, uiautomation, inspect

Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

windows ui automationautomate windows applicationswindows control inspectionui element interaction windowswindows accessibility automationdesktop automation windowswindows app testing automation
windows-automationui-testingaccessibility

More Testing packages