The driver follows Playwright’s synchronous Python API, and selectors match with Playwright’s own engine, so a locator that finds an element in Playwright finds the same element here.
from playwright.sync_api import sync_playwright, expect

with sync_playwright() as p:
    browser = p.chromium.launch()
    page = browser.new_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 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()
Only the import and where the page comes from change. Selectors, key names (Enter, Control+a), load states (domcontentloaded, networkidle), timeouts in milliseconds, set_default_timeout, expect and TimeoutError carry over.

Differences

evaluate runs in an isolated world

Playwright’s evaluate runs in the page’s main world. Here it runs in an isolated world: the same DOM, but not the page’s own JavaScript globals, and invisible to the page. DOM work is unaffected. To read a page global such as window.myApp, pass world="main":
page.evaluate("() => window.myApp.state", world="main")
The same goes for locator.evaluate, evaluate_all and wait_for_function.
arg is passed as the function’s single argument, as in Playwright: page.evaluate("([a, b]) => a + b", [1, 2]). A thrown error raises EvaluationError.
A session is one Chrome with one profile. browser.contexts has one entry, browser.new_context() returns it, and page.context is it. Open tabs with browser.new_page().
Actions bring their tab to the front first, because only the visible tab receives input. keyboard.down() and keyboard.up() aren’t available; use keyboard.press() with a chord such as Shift+Tab.
As in Playwright, actions and single-element reads fail when a locator matches several elements. Here the TimeoutError comes at once, with a message saying how many matched.
page.set_default_timeout() and page.set_default_navigation_timeout() work as in Playwright. Without them, locator calls default to 5,000 ms and navigation to 30,000 ms. A locator call waits at most 60,000 ms, so a longer default is cut to that for locators. Navigation waits at most 120,000 ms.
set_input_files takes what Playwright takes: a path, a payload {"name", "mimeType", "buffer"}, or a list of either. [] clears the input. The browser runs in its own machine, so the driver first copies each file there, then sets it on the input. Each file can be up to 32 MiB.
page.get_by_label("Resume").set_input_files("cv.pdf")
With no listener, alert, confirm and prompt are dismissed and beforeunload is accepted, as in Playwright. A page.on("dialog") listener holds each dialog open until it calls dialog.accept() or dialog.dismiss(). The listener runs at your next call on the page, not the moment the dialog opens:
page.on("dialog", lambda d: d.accept())
page.get_by_role("button", name="Delete").click()
page.frame_locator() takes a CSS selector for the <iframe>, such as "iframe[title='Checkout']". Inside it, every locator works as on a page. page.frames, page.main_frame and page.frame(name=..., url=...) work too. aria_snapshot() and get_text() read the main frame only.
The block ends once the download has finished, not when it starts. download.save_as() and download.path() copy the file from the session’s machine to yours.
expect_popup() returns the new tab’s Page, as in Playwright. Input is real, so a tab comes to the front when you act on it, opener or popup.

Compatibility

PlaywrightHalyard
goto, reload, go_back, go_forwardSupported
url, title(), content(), set_contentSupported
wait_for_load_state, wait_for_url, wait_for_selector, wait_for_function, wait_for_timeoutSupported
evaluate, eval_on_selector, eval_on_selector_allSupported (isolated world by default)
locator, every get_by_*Supported
click, fill, type, press, check and the other selector shortcutsSupported
keyboard, mouse, screenshot (PNG or JPEG), aria_snapshotSupported
set_viewport_size, viewport_size, bring_to_front, closeSupported
set_default_timeout, set_default_navigation_timeoutSupported
set_input_filesSupported
on("dialog"), once("dialog"), remove_listener("dialog")Supported
expect_event and wait_for_event for "dialog" and "download", expect_downloadSupported
frames, main_frame, frame, frame_locatorSupported (frame_locator takes CSS)
expect_popup, expect_event("popup")Supported
screenshot(full_page=True)Not yet
add_init_script, route, pdf, events other than "dialog"Not yet