Skip to main content

Scroll Web Element into View

Command description

Scroll the webpage until the specified element enters the browser viewport.

Command Input Parameters

input parametersInput parameter typeDescription
Webpage ObjectWebPageWebpage containing the element
Web ElementWebElement or str (captured element UID, not element name, not ms-rpa-id)Select a captured element or one returned by Get Web Element, Get Similar Web Elements, or Get Related Web Elements
Horizontal PositionenumDefault, Left, Right, Center
Vertical PositionenumDefault, Top, Bottom, Center
Element Wait DurationnumberMaximum time to wait for the element to appear, in seconds
Post-Execution DelaynumberTime to wait after scrolling, in seconds

Command Output Parameters

None

Type definition reference

Horizontal position

  • Default: If the element is already in the browser window, the web page will not be scrolled. When the element is on the left side of the browser window, the effect is the same as Left, otherwise it is the same as Right
  • Left: Regardless of whether the element is within the browser window, always scroll the web page to ensure that the left edge of the element is aligned with the left edge of the browser window
  • Right: Regardless of whether the element is within the browser window, always scroll the web page to ensure that the right edge of the element is aligned with the right edge of the browser window
  • Center: Regardless of whether the element is within the browser window, always scroll the web page to ensure that the element is located in the horizontal center position of the browser window

Vertical position

  • Default: If the element is already in the browser window, the web page will not be scrolled. When the element is at the bottom of the browser window, the effect is the same as Bottom, otherwise it is the same as Top
  • Top: Regardless of whether the element is within the browser window, always scroll the web page to ensure that the top edge of the element is aligned with the top edge of the browser window.
  • Bottom: Regardless of whether the element is within the browser window, always scroll the web page to ensure that the bottom edge of the element is aligned with the bottom of the browser window.
  • Center: Regardless of whether the element is within the browser window, always scroll the web page to ensure that the element is located in the vertical center position of the browser window

Some web pages may have floating bars at the top and bottom. To prevent elements from being blocked by the floating bars, you can choose center

tip

Example

FAQ

See Web Automation FAQ