scrollBy(driver, xPixels, yPixels)
scrollBy
Parameters:
Name | Type | Description |
---|---|---|
driver |
Object |
webdriver object of web browser. |
xPixels |
Number |
to how much you want to scroll down/up from current position. |
yPixels |
Number |
to how much you want to scroll leftr/right from current position. |
Example
Examples usage of scrollBy
scrollBy(driver, xPixels, yPixels).then(() => {
// It will scroll down/up to the pixels user give from the current position.
// It will scroll left/right to the pixels user give from the current position.
// To scroll up/right you have to give pixels in negative.
}).catch((error) => {
// handle error
});