Actually memoize the attributes of a Selenium node

This commit is contained in:
Olek Janiszewski 2012-09-19 11:05:30 +02:00
parent 2c57735b60
commit 1d8a0ef4a8
1 changed files with 1 additions and 1 deletions

View File

@ -5,7 +5,7 @@ class Capybara::Selenium::Node < Capybara::Driver::Node
end
def [](name)
@attrs = {}
@attrs ||= {}
@attrs[name] ||= native.attribute(name.to_s)
rescue Selenium::WebDriver::Error::WebDriverError
nil