Registry / testing / uiautomation

uiautomation

JSON →
library2.0.29pypypiunverified

Python library for Windows UI Automation, enabling control of desktop applications via Microsoft UI Automation API. Current version 2.0.29, active development with occasional releases.

pip install uiautomation
INSTALL
IMPORT
SIG · UIAUTOMATION
U
uiautomation
testingpythonv2.0.29
Install
1.9s avg
Import
Disk
20MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.0.29 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 21.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.9s · import 0.000s · 22MB
20MB installed
● package 20MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

uiautomation
import uiautomation
import uiautomation as auto

Finds Notepad window, sends text, and closes it.

import uiautomation as auto # Launch Notepad if not running if not auto.WindowControl(searchDepth=1, Name='Untitled - Notepad').Exists(0,0): os.system('notepad') time.sleep(1) window = auto.WindowControl(searchDepth=1, Name='Untitled - Notepad') edit = window.EditControl() edit.Click() edit.SendKeys('Hello, UI Automation!') print('Text sent.') window.GetWindowPattern().Close()
Debug
Known issues
breakingPython 3.12+ may break due to changes in ctypes and COM. Tested up to 3.11.
fix
Use Python 3.11 or lower, or monitor GitHub issues for compatibility fixes.
affects: >=2.0.0
gotchaControls are found with 'searchDepth' or 'searchFromRoot=False'. Default searchDepth is 0 (immediate children) which often finds nothing.
fix
Always specify searchDepth (e.g., 1 for top-level windows) or use Control(searchFromControl=root).
affects: all
gotchaSendKeys may not work on elevated (admin) apps if script is not elevated.
fix
Run script as administrator or use SetFocus before SendKeys.
affects: all
Upgrade
Version history
2.0.29latest on PyPI · released Aug 5, 2025
Audit
Dependencies
comtypesrequiredRequired for COM interop with UIA
Agent activity
6 hits · last 30 days
node
6
Resources
uiautomation — pip install uiautomation · libregistry