click
Perform real CDP mouse presses in the active browser tab via CSS selector or viewport coordinates, enabling trusted handlers, popups, and form actions that synthetic JavaScript events can miss.
Instructions
Click in the session's active tab with real CDP mouse input (trusted events — fires handlers reliably and grants user activation, so it can open popups/new tabs that a JS click can't). Pass a CSS selector to click the first match's center, after waiting up to timeout for it and scrolling it into view; or pass both x and y to click viewport coordinates, which are used only when there is no selector. Don't use evaluate to click: synthetic JS clicks can be ignored by pages. Coordinates outside the viewport are not rejected; the click lands on nothing. A click can submit forms or trigger purchases, like a real user's. Returns a confirmation naming what was clicked. Fails if the selector matches nothing within timeout, or if neither a selector nor both coordinates are given.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | Horizontal viewport coordinate in CSS pixels, used with `y` when no selector is given. | |
| y | No | Vertical viewport coordinate in CSS pixels, used with `x` when no selector is given. | |
| timeout | No | Milliseconds to wait for `selector` to appear. Default 5000. | |
| selector | No | CSS selector of the element to click; the first match is used. | |
| sessionId | Yes | The id returned by open_browser_session. Errors if no open session has it. |