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

Fix deprecation warning in selenium driver.

As of selenium-webdriver 0.2.0:
"Selenium::WebDriver::Element#value is deprecated, please use Selenium::WebDriver::Element#attribute('value')"
This commit is contained in:
Aaron Gibralter 2011-04-27 15:17:56 -07:00
parent 65ba487d22
commit f02754183b

View file

@ -15,9 +15,9 @@ class Capybara::Selenium::Node < Capybara::Driver::Node
def value
if tag_name == "select" and self[:multiple] and not self[:multiple] == "false"
native.find_elements(:xpath, ".//option").select { |n| n.selected? }.map { |n| n.value || n.text }
native.find_elements(:xpath, ".//option").select { |n| n.selected? }.map { |n| n.attribute('value') || n.text }
else
native.value
native.attribute('value')
end
end