Method: Selenium::WebDriver::KeyActions#key_up

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

#key_up(key, device: nil) ⇒ ActionBuilder #key_up(element, key, device: nil) ⇒ ActionBuilder

Performs a key release. Releasing a non-depressed key will yield undefined behaviour.

Examples:

Release a key


driver.action.key_up(:shift).perform

Release a key from an element


el = driver.find_element(id: "some_id")
driver.action.key_up(el, :alt).perform

Overloads:

  • #key_up(key, device: nil) ⇒ ActionBuilder

    Parameters:

    • key (Symbol, String)

      The key to press

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

      Optional name of the KeyInput device to press the key on

  • #key_up(element, key, device: nil) ⇒ ActionBuilder

    Parameters:

    • element (Element)

      An optional element to move to first

    • key (Symbol, String)

      The key to release

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

      Optional name of the KeyInput device to release the key on

Returns:

[View source]

74
75
76
# File 'lib/selenium/webdriver/common/interactions/key_actions.rb', line 74

def key_up(*args, device: nil)
  key_action(*args, action: :create_key_up, device: device)
end