Method: Selenium::WebDriver::Element#clear

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

#clearObject

If this element is a text entry element, this will clear the value. Has no effect on other elements. Text entry elements are INPUT and TEXTAREA elements.

Note that the events fired by this event may not be as you’d expect. In particular, we don’t fire any keyboard or mouse events. If you want to ensure keyboard events are fired, consider using #send_keys with the backspace key. To ensure you get a change event, consider following with a call to #send_keys with the tab key.



222
223
224
# File 'lib/selenium/webdriver/common/element.rb', line 222

def clear
  bridge.clear_element @id
end