Method: Selenium::WebDriver::PointerActions#double_click

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

#double_click(element = nil, device: nil) ⇒ ActionBuilder

Performs a double-click at middle of the given element. Equivalent to:

driver.action.move_to(element).double_click

When no element is passed, the current mouse position will be double-clicked.

Examples:

Double-click an element


el = driver.find_element(id: "some_id")
driver.action.double_click(el).perform

Double-clicking at the current mouse position


driver.action.double_click.perform

Parameters:

  • element (Selenium::WebDriver::Element) (defaults to: nil)

    An optional element to move to.

  • device (Symbol || String) (defaults to: nil)

    optional name of the PointerInput device with the button that will be double-clicked

Returns:


255
256
257
258
259
260
# File 'lib/selenium/webdriver/common/interactions/pointer_actions.rb', line 255

def double_click(element = nil, device: nil)
  move_to(element, device: device) if element
  click(device: device)
  click(device: device)
  self
end