Version: 1.3.0
Mouse
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
.
- mouse.click(x, y[, options])
- mouse.dblclick(x, y[, options])
- mouse.down([options])
- mouse.move(x, y[, options])
- mouse.up([options])
#
mouse.click(x, y[, options])x
<number>y
<number>options
<Object>button
<"left"|"right"|"middle"> Defaults toleft
.clickCount
<number> defaults to 1. See UIEvent.detail.delay
<number> Time to wait betweenmousedown
andmouseup
in milliseconds. Defaults to 0.
- returns: <Promise>
Shortcut for mouse.move
, mouse.down
and mouse.up
.
#
mouse.dblclick(x, y[, options])x
<number>y
<number>options
<Object>button
<"left"|"right"|"middle"> Defaults toleft
.delay
<number> Time to wait betweenmousedown
andmouseup
in milliseconds. Defaults to 0.
- returns: <Promise>
Shortcut for mouse.move
, mouse.down
, mouse.up
, mouse.down
and mouse.up
.
#
mouse.down([options])options
<Object>button
<"left"|"right"|"middle"> Defaults toleft
.clickCount
<number> defaults to 1. See UIEvent.detail.
- returns: <Promise>
Dispatches a mousedown
event.
#
mouse.move(x, y[, options])x
<number>y
<number>options
<Object>steps
<number> defaults to 1. Sends intermediatemousemove
events.
- returns: <Promise>
Dispatches a mousemove
event.
#
mouse.up([options])options
<Object>button
<"left"|"right"|"middle"> Defaults toleft
.clickCount
<number> defaults to 1. See UIEvent.detail.
- returns: <Promise>
Dispatches a mouseup
event.