Skip to content

Commit

Permalink
Selenium prefers value over text for multiple select options
Browse files Browse the repository at this point in the history
  • Loading branch information
jnicklas committed Oct 8, 2010
1 parent 7322537 commit b646c8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/capybara/driver/selenium_driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def [](name)

def value
if tag_name == "select" and self[:multiple]
native.find_elements(:xpath, ".//option").select { |n| n.selected? }.map { |n| n.text }
native.find_elements(:xpath, ".//option").select { |n| n.selected? }.map { |n| n.value || n.text }
else
self[:value]
end
Expand Down

0 comments on commit b646c8b

Please sign in to comment.