When I scroll

The scroll steps group provides actions for controlling page and element scroll position. Both vertical scrolling (up, down, to top, to bottom) and horizontal scrolling (left, right, to start, to end) are covered. All steps work against the current browser page context and can also be scoped to a specific element by CSS selector.

Every step accepts three pronoun forms: I scroll, we scroll, or just scrolling. Where a pixel amount is optional, the default delta is 350 px. Pixel-delta steps use window.scrollBy for relative movement, while absolute-position steps use window.scrollTo. Element-scoped steps locate the element with Playwright's locator API and set scrollTop or scrollLeft directly, then dispatch a scroll event so listeners are notified.

Steps in this group

Back to Scroll Steps