View Source Improve this doc

scroll

Scroll to a specific element. You can also append/pass two offset values as parameter to scroll to a specific position.

Usage

1
2
browser.scroll([selector][,xoffset][,yoffset]);

Parameters

Param Type Details
selector
optional
String element to scroll to
xoffset
optional
Number x offset to scroll to
yoffset
optional
Number y offset to scroll to

Example

scroll.js
1
2
3
4
5
6
7
8
9
10
11
12
13
it('should demonstrate the scroll command', function () {
var elem = $('#myElement');
// scroll to specific element
elem.scroll();
// scroll to specific element with offset
// scroll offset will be added to elements position
elem.scroll(100, 100);
// scroll to specific x and y position
browser.scroll(0, 250);
});

Uses