Skip to main content

scroll

codebolt.browser.scroll(direction: string, pixels: string): Promise<unknown>
Scrolls the current page in a specified direction by a specified number of pixels.

Parameters

NameTypeDescription
directionstringThe direction to scroll.
pixelsstringThe number of pixels to scroll.

Returns:

 Promise<unknown>
A promise that resolves when the scroll action is complete.

Example


// Scroll down the page by 500 pixels
await codebolt.browser.scroll("down", "500");


Explanation

The codebolt.browser.scroll(direction: string, pixels: string) function is used to scroll the current page in a specified direction by a specified number of pixels. This function is useful for automating scrolling actions on a web page, such as navigating through lengthy content or bringing specific elements into view.