Methods
click
- click(x: number, y: number, options: ClickOptions): Promise<void>
-
Parameters
Returns Promise<void>
down
-
Parameters
Returns Promise<void>
move
- move(x: number, y: number, options?: { steps: number }): Promise<void>
-
Parameters
-
x: number
-
y: number
-
Optional options: { steps: number }
Returns Promise<void>
up
-
Parameters
Returns Promise<void>
The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport.
Every page object has its own Mouse, accessible with page.mouse.
// Using ‘page.mouse’ to trace a 100x100 square. await page.mouse.move(0, 0); await page.mouse.down(); await page.mouse.move(0, 100); await page.mouse.move(100, 100); await page.mouse.move(100, 0); await page.mouse.move(0, 0); await page.mouse.up();