Shortcut for mouse.move, mouse.down and mouse.up.
Dispatches a mousedown event.
Starts a drag from start to target and returns the drag data (Page.setDragInterception must be on).
Drag data that names files is refused: the button is released and the call fails.
Drags from start and drops at target in one call (drag, dragenter, dragover, drop). Drag data that names files is
refused.
Optionaloptions: { delay?: number }
delay: milliseconds between dragover and drop
Dispatches a dragenter event at target with data (from Mouse.drag). Drag data with files is refused.
Dispatches a dragover event at target with data (from Mouse.drag). Drag data with files is refused.
Dispatches a drop event at target with data (from Mouse.drag). Drag data with files is refused.
Dispatches a mousemove event.
Optionaloptions: { steps: number }Releases every pressed mouse button and moves the mouse back to (0, 0).
Dispatches a mouseup event.
Dispatches a mouse wheel event at the current mouse position.
await page.mouse.move(400, 300);
await page.mouse.wheel({ deltaY: 500 });
Optionaloptions: { deltaX?: number; deltaY?: number }
deltaX, deltaY in CSS pixels (default 0)
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.