Skip to main content

scroll

Scrolls the page to an element, to an offset (distance) from element or to an offset from the top of the page.

scroll(elemId)
# Or
scroll(elemId, x, y)
# Or
scroll(x, y)

Parameters#

  • elemId: Target element
  • x: A number. Offset in x axis in pixels, can be negative. Applies only when the page has a horizontal scroll.
  • y: A number. Offset in y axis in pixels, can be negative.

Returns#

  • No value

Example#

scroll(findElement('Submit', by.text))# scrolls page to the element
scroll(0, 200)# scrolls page to 200px down