Method: Selenium::WebDriver::Element#send_keys

Defined in:
lib/selenium/webdriver/common/element.rb

#send_keys(*args) ⇒ Object Also known as: send_key

Send keystrokes to this element

Examples:

element.send_keys "foo"                     #=> value: 'foo'
element.send_keys "tet", :arrow_left, "s"   #=> value: 'test'
element.send_keys [:control, 'a'], :space   #=> value: ' '

Parameters:

  • args (String, Symbol, Array)

    keystrokes to send

See Also:

[View source]

207
208
209
# File 'lib/selenium/webdriver/common/element.rb', line 207

def send_keys(*args)
  bridge.send_keys_to_element @id, Keys.encode(args)
end