Skip to content

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

ParameterTypeDescription
ctxContextContext object.
selectorstringCSS selector for the target element.
options?MouseClickOptionsButton 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});

Matterway Assistant SDK Documentation