page.mouse moves the real pointer. Points are the page’s CSS pixels from the
viewport’s top-left, the same space as locator.bounding_box() and
page.screenshot(). For elements, prefer locator actions, which find, wait and
aim for you.
down(), up() and wheel()
without a point act there.
mouse.click() and mouse.dblclick()
| Parameter | Type | Default | Description |
|---|---|---|---|
x, y | float | required | The point, in CSS pixels. |
button | str | None | "left" | "left", "right" or "middle". |
click_count | int | None | 1 | 2 for a double click. |
delay | float | None | None | Accepted for compatibility. |
mouse.move()
steps is accepted for compatibility; the pointer moves in one go.
mouse.down() and mouse.up()
Press or release a button where the mouse is, or at x, y.
mouse.wheel()
Scroll by delta_x and delta_y pixels where the mouse is, or at x, y.
Positive delta_y scrolls down.
InvalidArgsError for a point outside the session’s window, since the
pointer would land outside the page.