moveToElement

Scrolls the page to the specified element, emulates mouse cursor movement to specified coordinates relative to the element

Syntax

moveToElement = function(aElement, aPointCount, aInterval, aX, aY, aScrollMethod);

Parameters

  • aElement
    • functions: element which has to be clicked
  • aPointCount
    • functions: number of intermediate points during the motion
  • aInterval
    • functions: delay (in ms) between the intermediate points
  • aX
    • functions: X coordinate with respect to the upper left corner of the element
  • aY
    • functions: Y coordinate with respect to the upper left corner of the element
  • aScrollMethod
    • functions: scrolling method

Returned value

  • functions: flag indicating whether the movement is committed

Notes

  • Click will take place only on the element of the non-zero size
  • If aX and aY are zero, a random point of the rectangle containing the element will be selected
  • If aPointCount and aInterval are zero, they will be automatically calculated depending on the coordinates of the element

Examples

  1. loadURI('google.ru');
    typeIn('test');
    var search = getElement('button',0,['name'],['btnG']);
    moveToElement(search,0,0,0,0,SM_SCROLLBAR);