Module: Watir::UserEditable

Included in:
TextArea, TextField
Defined in:
lib/watir-webdriver/user_editable.rb

Instance Method Summary collapse

Instance Method Details

#append(*args) ⇒ Object Also known as: <<

Appends the given value to the text in the text field.

Parameters:

  • *args (String, Symbol)


25
26
27
28
29
30
# File 'lib/watir-webdriver/user_editable.rb', line 25

def append(*args)
  assert_exists
  assert_writable

  @element.send_keys(*args)
end

#clearObject

Clears the text field.



37
38
39
40
# File 'lib/watir-webdriver/user_editable.rb', line 37

def clear
  assert_exists
  @element.clear
end

#set(*args) ⇒ Object Also known as: value=

Clear the element, the type in the given value.

Parameters:

  • *args (String, Symbol)


10
11
12
13
14
15
16
# File 'lib/watir-webdriver/user_editable.rb', line 10

def set(*args)
  assert_exists
  assert_writable

  @element.clear
  @element.send_keys(*args)
end