1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

Selenium prefers value over text for multiple select options

This commit is contained in:
Jonas Nicklas 2010-10-08 15:50:27 +02:00
parent 7322537335
commit b646c8b4a1

View file

@ -18,7 +18,7 @@ class Capybara::Driver::Selenium < Capybara::Driver::Base
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