FlaUI for Python
The complete FlaUI Windows UI Automation API — made Pythonic, typed, and batteries-included.

Automate any Windows application — WinForms, WPF, Win32, or Store apps — from Python with a clean, fully typed API that maps 1:1 to the battle-tested FlaUI C# library. No driver binaries to manage, no framework lock-in.
Get started API Reference Why FlaUI for Python?
Installation
FlaUI for Python targets Python 3.11–3.15 on Windows (the bundled FlaUI DLLs require the Windows UI Automation stack). All C# dependencies ship inside the wheel — there are no external drivers to install.
Install not working?
Use 64-bit CPython 3.11–3.15 with the .NET Framework 4.8 runtime (built into
Windows 10 1903+, Windows 11 and Windows Server 2022+). On Python 3.10 or older, pip quietly
installs a legacy 0.x release instead of failing. For that, missing runtimes, blocked DLLs,
proxies and offline installs, see
Installation problems.
Trying a beta
We publish 1.0.0bN betas on the road to v1.0. Pre-releases are not installed by default —
opt in explicitly:
See Road to v1.0 for the beta-soak plan and how to give feedback.
Get Started
Why the C# examples?
Upstream FlaUI has limited written documentation, so throughout these docs we pair each Python snippet with the equivalent C# code for reference. If you have seen a pattern in the original C# library, the side-by-side tabs make it easy to map it onto the Python API.
# Standard initialization
from flaui.lib.pythonnet_bridge import setup_pythonnet_bridge
setup_pythonnet_bridge()
from flaui.modules.automation import Automation
from flaui.lib.enums import UIAutomationTypes
with Automation(UIAutomationTypes.UIA3) as automation:
automation.application.launch_store_app("Microsoft.WindowsCalculator_8wekyb3d8bbwe!App")
window = automation.application.get_main_window(automation)
window.find_first_descendant(automation.cf.by_automation_id("num7Button")).as_button().invoke()
using FlaUI.UIA3;
using FlaUI.Core;
using var automation = new UIA3Automation();
using var app = Application.LaunchStoreApp("Microsoft.WindowsCalculator_8wekyb3d8bbwe!App");
var window = app.GetMainWindow(automation);
window.FindFirstDescendant(cf => cf.ByAutomationId("num7Button")).AsButton().Invoke();
The full Calculator script, plus Notepad and the bundled test apps, is in the Example Gallery. Every snippet there runs.
Performance
| Measured median | |
|---|---|
| Overhead over calling FlaUI C# directly | None measurable (under the 5 ms gate on every operation) |
Element lookup vs pywinauto's uia backend |
1.5–5.6× faster (35 ms vs 198 ms by name on WinForms) |
| Mouse click vs pywinauto | 4.5–5× faster (127 ms vs 566 ms on WinForms)¹ |
Setup: Windows 11, Python 3.11, the bundled WinForms and WPF test apps, wrapper on UIA3, 100 runs,
default timings on both sides. ¹ pywinauto waits out the double-click time before every click.
pywinauto's win32 backend beats both libraries' UIA paths on finds and checkbox/radio actions
where it applies (WinForms only, no AutomationId); its clicks take as long as uia's. Full numbers: Performance.
Why FlaUI for Python?
-
Native UI Automation
Built on Microsoft's UI Automation (UIA) so you can inspect and drive any Windows application — WinForms, WPF, Win32, and Store apps alike.
-
Modern & Typed
Every element, pattern, and coordinate is backed by Pydantic — giving you autocompletion, IDE intellisense, and validation before calls cross the interop boundary.
-
Batteries Included
Zero-configuration setup. All FlaUI DLLs are bundled in the wheel — no driver binaries or external runtimes to manage.
-
Dual-Backend Support
Switch seamlessly between UIA3 (COM-based, for modern apps) and UIA2 (managed, for legacy apps) with a single argument.
-
Advanced Element Search
Find elements by Accessibility ID, Name, XPath, or arbitrary
ConditionFactorylogic — plus a full set of UIA patterns (Toggle, Select, Expand, Scroll, …). -
Resilient & Debuggable
Built-in
Retry, dynamic timeouts, and input waiting keep tests stable; on-screen overlays, capture, and video recording make failures easy to diagnose.
Works with any test framework
No lock-in to a single runner. Use FlaUI for Python with pytest, unittest, Robot Framework, Behave, TestPlan, or your own harness — see the Examples.
Bundled Library Versions
FlaUI Binary Versions
| Library | Version | Framework | Dependency | License |
|---|---|---|---|---|
| Core | 5.0 | .Net Framework 4.8 | System.CodeDom.dll | MIT |
| UIA3 | 5.0 | .Net Framework 4.8 | System.CodeDom.dll | MIT |
| UIA2 | 5.0 | .Net Framework 4.8 | Interop.UIAutomationClient.dll, System.CodeDom.dll | MIT |
Inspirations & Credits
- FlaUI: The core logic and test applications are derived from the upstream C# project.
- robotframework-flaui (GDATA): The prior-art Python integration for FlaUI that influenced this project's direction.
- Python.NET: The interop bridge that makes calling FlaUI from Python possible.
- Playwright /
pytest-playwrightand FlaUIRecorder: Inspirations for the planned recorder and pytest tooling. - Community: Special thanks to the contributors of FlaUI and the Python.NET team.
Next Steps
- Basics: Learn the core workflow: Initialize → Launch → Find → Interact.
- Advanced Concepts: Master XPath, ConditionFactory, and Caching.
- API Reference: Explore the full method documentation for every control.
- Troubleshooting: Resolve common setup and finding issues.
- Road to v1.0: See how the project gets to a stable
v1.0.0, how to test betas, and how docs are versioned.