hubcap scrolltop

Scroll to the top of the page.

When to use

Use scrolltop to scroll the page to the very top. Use scrollto to scroll to a specific element, scrollbottom to go to the end, or scroll for relative pixel-based scrolling.

Usage

hubcap scrolltop

Arguments

None.

Flags

None.

Output

FieldTypeDescription
scrolledbooleanWhether the scroll action completed
{
  "scrolled": true
}

Errors

ConditionExit codeStderr
Chrome not connected2error: connecting to Chrome: ...
Timeout3error: timeout

Examples

Scroll to the top:

hubcap scrolltop

Scroll to the bottom to trigger lazy loading, then back to the top:

hubcap scrollbottom && hubcap waitidle && hubcap scrolltop

Take a screenshot from the top of the page:

hubcap scrolltop && hubcap screenshot --output top.png

See also