uiautomation
Python UIAutomation for Windows
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 uiautomationuv
uv add uiautomationpoetry
poetry add uiautomationInstalling 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
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
pywinautoAutomate Microsoft Windows GUI interactions by…
permissive · top 5,000 on PyPI
PyAutoItPyAutoIt provides Python bindings to…
permissive · top 15,000 on PyPI
uiautomatorPython wrapper for Android's uiautomator…
permissive · top 15,000 on PyPI
win-precise-timeProvides high-resolution time measurement and…
permissive · top 15,000 on PyPI
PymemPymem provides direct read and write access to…
permissive · top 15,000 on PyPI
robotframework-whitelibraryWhiteLibrary automates Windows GUI testing for…
permissive · top 15,000 on PyPI
PyAutoGUIPyAutoGUI programmatically controls the mouse…
permissive · top 5,000 on PyPI
wmctrlwmctrl provides programmatic control over…
permissive · top 15,000 on PyPI
PyGetWindowPyGetWindow provides functions to query,…
permissive · top 5,000 on PyPI
facebook-wdaPython client library for controlling iOS…
permissive · top 15,000 on PyPI