Overview

The SCROLL step allows you to scroll the page or within a specific element. It supports multiple scroll directions, different scroll amounts, and both instant and smooth scrolling behaviors.

Parameters

targetDescription
string
Container element selector to scroll within. If not provided, scrolls the entire page.
direction
enum
required
Scroll direction. Options:
  • down - Scroll downward
  • up - Scroll upward
  • left - Scroll left
  • right - Scroll right
  • top - Scroll to top
  • bottom - Scroll to bottom
scrollBy
enum
default:"viewport"
How to calculate scroll amount:
  • pixels - Scroll by specific pixel amount
  • viewport - Scroll by viewport percentage
  • end - Scroll to the end in the specified direction
amount
number
default:"300"
Amount to scroll (only used when scrollBy is “pixels”)
behavior
enum
default:"instant"
Scroll behavior:
  • instant - Jump immediately to position
  • smooth - Animate scroll smoothly
waitAfter
number
default:"100"
Time to wait after scrolling (in milliseconds)

Behavior

  1. Element Location: If targetDescription is provided, finds the scrollable container
  2. Scroll Calculation: Calculates scroll distance based on direction and scrollBy mode
  3. Scroll Action: Performs the scroll with specified behavior
  4. Wait: Waits for the specified duration after scrolling

Common Use Cases

  • Loading lazy-loaded content
  • Navigating through long pages
  • Testing infinite scroll implementations
  • Accessing content below the fold
  • Scrolling within modal dialogs or containers
  • Testing horizontal scrolling galleries

Error Handling

The step will fail if:
  • The specified container element cannot be found
  • The element or page is not scrollable in the specified direction
  • The scroll action cannot be performed
Error messages indicate whether the issue is with element selection or scroll capability.