Method: Watir::Button#text

Defined in:
lib/watir/elements/button.rb

#textString

Returns the text of the button.

For input elements, returns the “value” attribute. For button elements, returns the inner text.

Returns:

  • (String)


24
25
26
# File 'lib/watir/elements/button.rb', line 24

def text
  tag_name == 'input' ? value : super
end