public Actions moveToElement ( WebElement target , int xOffset , int yOffset ) { if ( isBuildingActions ( ) ) { action . addAction ( new MoveToOffsetAction ( jsonMouse , ( Locatable ) target , xOffset , yOffset ) ) ; } // Of course, this is the offset from the centre of the element. We have no idea what the width // and height are once we execute this method. LOG . info ( "When using the W3C Action commands, offsets are from the center of element" ) ; return moveInTicks ( target , xOffset , yOffset ) ; }
Moves the mouse to an offset from the top - left corner of the element . The element is scrolled into view and its location is calculated using getBoundingClientRect .