Appearance
Function: mouseClick()
ts
function mouseClick(
ctx: Context,
selector: string,
options?: MouseClickOptions): Promise<void>;Defined in: src/mouse/index.ts:158
Perform a configurable mouse click on an element.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | Context | Context object. |
selector | string | CSS selector for the target element. |
options? | MouseClickOptions | Button type, click count, delay, and success condition. |
Returns
Promise<void>
Example
ts
// Right-click a file row to open the context menu
await mouseClick(ctx, 'tr[data-file="report.pdf"]', {button: 'right', clickCount: 1});