Method: Selenium::WebDriver::WheelActions#scroll_by

Defined in:
lib/selenium/webdriver/common/interactions/wheel_actions.rb

#scroll_by(delta_x, delta_y, device: nil) ⇒ Selenium::WebDriver::WheelActions

Scrolls by provided amounts with the origin in the top left corner of the viewport.

Examples:

Scroll viewport by a specified amount

el = driver.find_element(id: "some_id")
driver.action.scroll_by(100, 200).perform

Parameters:

  • delta_x (Integer)

    Distance along X axis to scroll using the wheel. A negative value scrolls left.

  • delta_y (Integer)

    Distance along Y axis to scroll using the wheel. A negative value scrolls up.

Returns:

[View source]

58
59
60
# File 'lib/selenium/webdriver/common/interactions/wheel_actions.rb', line 58

def scroll_by(delta_x, delta_y, device: nil)
  scroll(delta_x: delta_x, delta_y: delta_y, device: device)
end