Method: Selenium::WebDriver::PointerActions#context_click

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

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

Performs a context-click at middle of the given element. First performs a move_to to the location of the element.

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

Examples:

Context-click at middle of given element


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

Context-clicking at the current mouse position


driver.action.context_click.perform


283
284
285
# File 'lib/selenium/webdriver/common/interactions/pointer_actions.rb', line 283

def context_click(element = nil, device: nil)
  click(element, button: :right, device: device)
end