View Source Improve this doc

moveTo

Move the mouse by an offset of the specificed element. If no element is specified, the move is relative to the current mouse cursor. If an element is provided but no offset, the mouse will be moved to the center of the element. If the element is not visible, it will be scrolled into view.

(Not part of the official Webdriver specification).

Usage

1
2
browser.moveTo(element,xoffset,yoffset);

Parameters

Param Type Details
element String Opaque ID assigned to the element to move to, as described in the WebElement JSON Object. If not specified or is null, the offset is relative to current position of the mouse.
xoffset Number X offset to move to, relative to the top-left corner of the element. If not specified, the mouse will move to the middle of the element.
yoffset Number Y offset to move to, relative to the top-left corner of the element. If not specified, the mouse will move to the middle of the element.