The Halyard driver controls three kinds of session with the same protocol, the Device Control Protocol (DCP):
  • Browsers: Chrome running in its own Windows machine. The Python API follows Playwright’s, so most browser scripts move over by changing the import.
  • Phones: real Android phones. You find things by text, accessibility role or a plain description, then tap, swipe and type.
  • Computers: a whole Windows desktop. The real mouse and keyboard anywhere on screen, plus its windows, processes, files and clipboard.
All three speak the same frames, the same locators and the same error kinds. Each serves the methods that fit it, and says which in its handshake.
from halyard import Browser, expect

with Browser.connect(control_url) as browser:
    page = browser.page
    page.goto("https://example.com")
    expect(page).to_have_title("Example Domain")
    page.get_by_role("link", name="Learn more").click()
from halyard import Phone, Key

phone = Phone.connect()
phone.get_by_text("Search").fill("coffee near me")
phone.key_press(Key.ENTER)
phone.get_by_role("button", name="Directions").first().tap()
from halyard import Client

computer = Client().computers.create()
try:
    with computer.connect() as pc:
        pc.processes.start("notepad.exe")
        pc.windows.wait_for(process="notepad.exe")
        pc.get_by_role("document", name="Text editor").fill("hello")
finally:
    computer.stop()

Two layers, one protocol

LayerWhat it isReach for it when
Python driverBrowser, Page, Locator and expect for browsers; Phone and its Locator for phones; Computer for a desktop.You write Python. Most code should start here.
DCPThe raw wire: {"id", "method", "params"} frames over the session’s control_url.You work in another language, or want the exact frames with nothing in between.
Both drive the same session: every driver call is one or a few DCP commands.

What makes it different

  • Real input. Browser clicks and keystrokes go through the machine’s own input system, and phone taps are real touches, so pages and apps see ordinary input.
  • Waiting happens in the session. An action finds its target, waits until it is ready, then acts, all in one round trip.
  • Finding works without markup. On a phone, a locator can match the accessibility tree, read the screen with OCR, or have a vision model find what you describe.
  • Browser scripts run in an isolated world. evaluate shares the page’s DOM but not its JavaScript, so the page can’t see or interfere with your scripts. Pass world="main" to reach page globals.

Next steps

Browser quickstart

Connect to a browser and drive a page.

Phone quickstart

Find things on a phone, tap and type.

Computer quickstart

Start a Windows desktop and work in it.

Porting from Playwright

What carries over, what differs, and the compatibility table.

Page reference

Every method on Page.

DCP overview

The wire underneath the driver.