Scroll the screen in a specified direction using the mouse wheel.
scroll
The scroll
command is used to scroll the screen in a specified direction using the mouse wheel. This is useful for navigating through content that extends beyond the visible area.
Argument | Type | Description |
---|---|---|
direction | string | The direction to scroll. Available directions are: up , down , left , right . |
amount | number | (Optional) Pixels to scroll. If not specified, a default amount is used. |
Be sure to focus the application and frame you are trying to scroll before using the command.
Use precise amount
values to control the scrolling distance for better accuracy in your tests.
Combine the scroll
command with other commands like hover-text
or match-image
to interact with elements that are initially off-screen.
The most reliable way to scroll to the top or bottom of the page is to use the home
and end
keys:
amount
value as needed.scroll
command is ideal for navigating through long pages or lists during automated tests.