Win Scroll
Win Scroll
Section titled “Win Scroll”Type: win-scroll · Package: Desktop Activities v1.0.8
Scrolls an element with a scroll bar —a long list, a grid, a panel— in the given direction. Useful to bring into view an item or a row that is outside the visible area before interacting with it.
How it works
Section titled “How it works”It locates the scrollable element by its selector, brings its window to the front and scrolls it amount steps in the given direction:
- If the control supports the UIA Scroll pattern, each step moves 10 % of the total range (never past the start or the end). If the control can’t scroll in that direction, nothing happens.
- If it doesn’t, it puts the mouse at the control’s center and turns the mouse wheel one notch per
amount(horizontal wheel forleft/right).
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
selector | selector | — | The scrollable element (the list, grid or panel, not an item inside it). |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
session | ZoanDesktopSession | — | Win Attach session. Inside a body it is taken automatically; without a session, the selector must include the window. |
direction | string | down | Direction: down · up · right · left. |
amount | int | 3 | Number of scroll steps, from 1 to 20 (values outside that range are clamped). |
timeout | number | 30000 | Maximum ms to wait for the element. Empty = the project’s UI timeout or, if not set, 30000. |
Output
Section titled “Output”This activity does not return a value.
Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
Element not found with selector {…}. | See common errors. |
If the content doesn’t move, check that the selector points to the container with the scroll bar and not to an element inside it.
Example
Section titled “Example”Win Scroll selector = (list "Results") direction = down amount = 5Win Click selector = (item "Order 1042")Related activities
Section titled “Related activities”- Win Extract Table — for grids, extract the data without scrolling by hand.
- Win Wait For — wait for an element to appear after scrolling.