Repository navigation
Home
Python implementation for Java application UI automation with Java Access Bridge.
pyjab drives Java Swing and AWT applications on Windows with an API shaped like the web-automation one you already know. It reads the application's accessibility tree through Java Access Bridge, so it can find controls, read their text, fill forms, click buttons and read tables without the target application exposing any API of its own.
JavaFX is not supported, and this page previously said it was. JavaFX on
Windows exposes its accessibility through UI Automation directly, not through
Java Access Bridge, so JAB does not see a JavaFX window as a Java window at all.
Measured 2026-10-11: UI Automation found 68 elements inside a JavaFX window where
JABDriver could not bind it, while the same run walked 614 elements of a Swing
window. See issue #227.
| Page | What it covers |
|---|---|
| 1. Overview | What pyjab is, and whether it fits your problem |
| 2. Getting Started | Installation, prerequisites, your first script |
| 3. pyjab | The API guide: locators, elements, actions, tables |
| 4. Support Packages | What pyjab depends on |
| 5. About this documentation | How these pages are maintained |
| 6. Troubleshooting | The problems people actually hit |
| 7. Changelog | What changed in each release |
from pyjab.common.by import By
from pyjab.jabdriver import JABDriver
with JABDriver(title="My Application") as driver:
driver.find_element_by_name("Login").click()
dashboard = driver.wait_until_element_exist(By.NAME, "Dashboard", timeout=30)
print(dashboard.name, dashboard.role)- Platform: Windows only.
- Requires: a JDK (or standalone Java Access Bridge), and Java Access Bridge enabled for the target application. pyjab enables it for you on first use.
- Does not require: any change to the target application. pyjab never restarts it, injects into it, or needs its source.
- Licence: MIT. See 1. Overview if you plan to ship a product that bundles pyjab.
- Source, issues and releases: https://github.com/gaozhao1989/pyjab
- Package: https://pypi.org/project/pyjab/