API ReferenceJavaDesktop
Desktop
Native macOS application automation through the installable desktop-mac XCUITest plugin. Windows and Linux are not available yet.
Allwright.desktop().mac().connect
Connects to the local macOS desktop and starts the bundled XCUITest runner automatically. Requires macOS 14 or newer, Xcode, and UI automation permission for the process running Xcode.
public MacDesktop connect()
public MacDesktop connect(DesktopMacConnectOptions options)Example
MacDesktop mac = Allwright.desktop().mac().connect();MacDesktop.launch
Launches an installed macOS application by bundle identifier. The returned app supports native locators, actions, text reads, waits, screenshots, and accessibility snapshots.
public synchronized MacApp launch()
public synchronized MacApp launch(DesktopMacLaunchOptions options)Example
MacApp app = mac.launch(new DesktopMacLaunchOptions("com.apple.TextEdit", false, null));MacApp locators and actions
Uses native XCUITest selectors and the Playwright-style role, text, label, and test-id locator subset. App methods include click, fill, focus, press, count, textContent, innerText, waitForSelector, screenshot, and accessibilitySnapshot.
public AndroidLocator locator(String selector)
public AndroidLocator getByRole(String role, RoleOptions options)