xa11y
A Playwright-style library for driving native desktop apps on macOS, Windows, and Linux. Built for end-to-end tests, computer-use agents, and assistive tools.
Use cases: end-to-end desktop testing, computer-use agents, MCP tools, assistive technology.
Documentation | Rust API | Python API | JavaScript API
Quick Example
import xa11y
safari = xa11y.App.by_name("Safari")
# Find elements with CSS-like selectors via locator
for button in safari.locator("button").elements():
print(button.name)
# Interact with elements via locator (re-resolves every call)
safari.locator("button[name='Submit']").press()
safari.locator("text_field[name^='Search']").set_value("hello world")
Installation
Python
pip install xa11y
Requires Python 3.9+. Pre-built wheels available for Linux, macOS, and Windows.
For pytest suites, pytest-xa11y adds
fixtures that launch the app under test, capability markers that skip what the
machine cannot do, and the accessibility tree on every failure:
pip install pytest-xa11y
On macOS, grant your terminal two permissions in System Settings > Privacy & Security:
- Accessibility, required for all accessibility API access. On macOS 27 and newer, grant it in Device Control and Data Access.
- Screen & System Audio Recording (macOS 26+), required to read window content. Without it, only menu bars are visible.
Restart your terminal after changing permissions.
On Linux, AT-SPI2 must be running (the default on GNOME and most desktop environments). Nothing else to grant.
Windows works as installed.
Selector Syntax
Query accessibility trees with CSS-like selectors:
| Pattern | Meaning |
|---|---|
button |
Elements with role Button |
button[name='OK'] |
Button named exactly "OK" |
text_field[name^='Search'] |
Text field whose name starts with "Search" |
text_field[name*='email'] |
Text field whose name contains "email" |
group > button |
Buttons that are direct children of a group |
window button |
Buttons anywhere inside a window |
button:nth(2) |
The 2nd button match |
Supported Actions
| Action | Description |
|---|---|
press |
Click / invoke |
focus / blur |
Move or remove keyboard focus |
toggle |
Toggle a checkbox or switch |
expand / collapse |
Expand or collapse a disclosure |
select |
Select an item |
set_value |
Set a text field's value |
type_text |
Type text into an element |
increment / decrement |
Adjust a slider or stepper |
show_menu |
Open a context menu |
Platform Support
| Platform | Backend |
|---|---|
| macOS | AXUIElement |
| Linux | AT-SPI2 (D-Bus) |
| Windows | UI Automation |
Ecosystem
- strands-xa11y packages xa11y as a desktop-control tool for Strands, AWS's open-source SDK for building AI agents. One tool gives an agent the accessibility tree and the actions on it; a read-only variant covers agents that observe and never act.
pip install strands-xa11y(requires Python 3.10+). - agent-desktop is a CLI built on xa11y for AI agents that read and control desktops.
Contributing
git clone https://github.com/xa11y/xa11y && cd xa11y
cargo build --workspace
cargo xtask check # fmt, lint, test, python bindings
See the development docs for architecture and testing strategy.
License
MIT. All dependencies are permissively licensed (MIT, Apache-2.0, BSD, or similar), enforced via cargo-deny.
Metadata
Release files for xa11y 0.15.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| xa11y-0.15.2.tar.gz | 678.2 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| xa11y-0.15.2-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details |
| xa11y-0.15.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| xa11y-0.15.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| xa11y-0.15.2-cp39-abi3-macosx_11_0_arm64.whl | CPython 3.9 | abi3 | macOS 11.0+ ARM64 | Details |
| xa11y-0.15.2-cp39-abi3-macosx_10_12_x86_64.whl | CPython 3.9 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 10.0 MB
Release files / xa11y-0.15.2.tar.gz
| Download URL | xa11y-0.15.2.tar.gz |
|---|---|
| Size | 678.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d18bb90fb7421f65b85f1f569fe675d2b975b200ae73d2891ad692597d297f15
|
|
BLAKE2b-256 checksum How to use checksums |
cb0226c9463a6c951cdece8d90a4abab903dbdb4605dd8a933f6081d8fb5f7d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logRelease files / xa11y-0.15.2-cp39-abi3-win_amd64.whl
| Download URL | xa11y-0.15.2-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
8be497ffbdb7da7f52f31d24945b663fdbe30f2b5fe1efc1956648f998321948
|
|
BLAKE2b-256 checksum How to use checksums |
66f4eb377364a478b99e7439dfe15f58805b9666b2161c61bf40357d0df45406
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logRelease files / xa11y-0.15.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | xa11y-0.15.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 3.0 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
2dc887db8243bd6de8c6c9e657eb8325a8bd42240fa21395c48a44c7dcd12420
|
|
BLAKE2b-256 checksum How to use checksums |
a4f001df35034db10289e35cfa96fef9490424f46deb9242f5715ec56d54822c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logRelease files / xa11y-0.15.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | xa11y-0.15.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 2.9 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
1c6fb07afa03b022453e94bcd918a9d260556bf55c0c04e76c3a06d072203f67
|
|
BLAKE2b-256 checksum How to use checksums |
eb56ffa55a7613640d99ed13f7031368511854b4152d6de9aaa945a8468eb9d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logRelease files / xa11y-0.15.2-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | xa11y-0.15.2-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
528e7b2c7537e7b73985b8704f5a8e84c15c819eecebe32f60de476f6dfb12e5
|
|
BLAKE2b-256 checksum How to use checksums |
e8d31dbd9c2573b088b084bd2c57dbce16384c259a48b64c8c97cb219f946494
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logRelease files / xa11y-0.15.2-cp39-abi3-macosx_10_12_x86_64.whl
| Download URL | xa11y-0.15.2-cp39-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.9 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
4df54c16f7ee6900ead3d21b2ed25b02e622738fc14f654685f54438a0ae7c9d
|
|
BLAKE2b-256 checksum How to use checksums |
65228d806a20c1d2a472dfa07871e0252ea4a40c0de7a487fb3e6c66d831bfdb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency log