Skip to main content

Overview

Scroll the page or active element in any direction using mouse wheel or keyboard.
Focus RequirementsScrolling requires the page or a frame to be focused. If an input field or other interactive element has focus, scroll commands may not work as expected. Before scrolling, ensure focus is on the page by:
  • Clicking on a non-interactive area (e.g., page background)
  • Pressing the Escape key to unfocus interactive elements
  • Clicking outside of input fields or text areas
If scroll is still not working, try using Page Down/Page Up keys directly:

Syntax

Parameters

string
default:"down"
Direction to scroll: 'up', 'down'
object

Returns

Promise<void>

Examples

Basic Scrolling

Horizontal Scrolling

Scroll Methods

Best Practices

Ensure page has focus before scrolling
Control scroll distance with the options object
Keyboard scroll uses Page Down/UpKeyboard scrolling typically moves by one β€œpage” at a time, which may be more than the specified click amount. It’s more compatible but less precise than mouse scrolling.

Use Cases

Complete Example