Page
Page is Tab under a type alias. Every action here also has a *_with_options twin (e.g. click_with_options) that accepts the same call plus a typed Options struct — shown once here, favoring the fuller signature. Tab::locator(...) and the get_by_* builders under Locator are also implemented directly on Tab.
click
Clicks the first matching element; click(...) omits options for the default timeout.
pub async fn click_with_options(&self, css_selector: impl Into<String>, options: CommandOptions) -> Result<ClickResult>Example
page.click("a[target=_blank]").await?;fill
Sets an input/textarea's value; fill(...) omits options for the default timeout.
pub async fn fill_with_options(&self, css_selector: impl Into<String>, value: impl Into<String>, options: CommandOptions) -> Result<FillResult>hover
Hovers the pointer over the matching element; hover(...) omits options for the default timeout.
pub async fn hover_with_options(&self, css_selector: impl Into<String>, options: CommandOptions) -> Result<ElementResult>press
Sends a key press to the matching element, optionally typing PressOptions.text; press(...) omits options.
pub async fn press_with_options(&self, css_selector: impl Into<String>, key: impl Into<String>, options: PressOptions) -> Result<PressResult>focus
Focuses the matching element; focus(...) omits options for the default timeout.
pub async fn focus_with_options(&self, css_selector: impl Into<String>, options: CommandOptions) -> Result<ElementResult>highlight
Visually highlights matching elements for a duration — a debugging aid; highlight(...) omits options.
pub async fn highlight_with_options(&self, css_selector: impl Into<String>, options: HighlightOptions) -> Result<HighlightResult>count
Returns how many elements match the selector; count(...) omits options for the default timeout.
pub async fn count_with_options(&self, css_selector: impl Into<String>, options: CommandOptions) -> Result<CountResult>text_content / inner_text
Reads the raw textContent, or (via inner_text) the rendered innerText, of the matching element.
pub async fn text_content_with_options(&self, css_selector: impl Into<String>, options: CommandOptions) -> Result<TextResult>Example
page.text_content(selector).await?;wait_for_selector
Waits, retrying, until the selector matches — WaitForSelectorOptions.visible optionally requires visibility.
pub async fn wait_for_selector_with_options(&self, css_selector: impl Into<String>, options: WaitForSelectorOptions) -> Result<WaitForSelectorResult>Example
page.wait_for_selector_with_options(selector, WaitForSelectorOptions { visible: Some(true), timeout_ms: Some(10_000) }).await?;screenshot
Captures a PNG screenshot; ScreenshotOptions.full_page captures the whole scrollable page, and .path writes the PNG to disk.
pub async fn screenshot_with_options(&self, options: ScreenshotOptions) -> Result<ScreenshotResult>accessibility_snapshot
Captures the accessibility tree as JSON or YAML text; AccessibilitySnapshotOptions.mode selects Default, Ai (stable aria-ref per node), Autoexpect, or Codegen.
pub async fn accessibility_snapshot_with_options(&self, options: AccessibilitySnapshotOptions) -> Result<String>locator
Builds a Locator scoped to this page for a CSS/XPath selector, or use the get_by_* semantic builders documented under Locator.
pub fn locator(&self, css_selector: impl Into<String>) -> Locatorregister_hook
Registers a lifecycle hook before the action that triggers it. HookType is sealed — only the provided NEW_PAGE/FILE_CHOOSER/DOWNLOAD tags implement it.
pub async fn register_hook<T: HookType>(&self, hook_type: T) -> Result<Hook<T>>