Scroll the screen in a specified direction using the mouse wheel.
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 . |
method | string | The method to scroll. Available methods are: mouse , keyboard . Defaults to mouse |
amount | number | (Optional) Pixels to scroll. If not specified, a default amount of 300 is used. |
amount
should only be used when the method
is mouse. If the method
is keyboard, it is redundant as the action performed is pressing the pageup
or pagedown
keys.amount
values to control the scrolling distance for better accuracy in your tests.
scroll
command with other commands like hover-text
or match-image
to interact with elements that are initially off-screen.
home
and end
keys:
amount
value as needed.scroll
command is ideal for navigating through long pages or lists during automated tests.