Command: scroll

Description

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.

Arguments

ArgumentTypeDescription
directionstringThe direction to scroll. Available directions are: up, down, left, right.
amountnumber(Optional) Pixels to scroll. If not specified, a default amount is used.

Example usage

command: scroll
direction: down
amount: 100

Protips

  • 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.

Gotchas

  • Scrolling too far may cause elements to move out of view. Adjust the amount value as needed.
  • Ensure the application or browser window is in focus when using this command to avoid unexpected behavior.

Notes

  • The scroll command is ideal for navigating through long pages or lists during automated tests.
  • This command supports both vertical and horizontal scrolling for flexible navigation.