Method: Capybara::Node::Simple#value
- Defined in:
- lib/capybara/node/simple.rb
#value ⇒ String
Returns The value of the form element.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/capybara/node/simple.rb', line 78 def value if tag_name == 'textarea' native['_capybara_raw_value'] elsif tag_name == 'select' = find_xpath('.//option[@selected]') if multiple? .map(&method(:option_value)) else option_value(.first || find_xpath('.//option').first) end elsif tag_name == 'input' && %w[radio checkbox].include?(native[:type]) native[:value] || 'on' else native[:value] end end |