Merge pull request #828 from exviva/actually_memoize
Actually memoize the attributes of a Selenium node
This commit is contained in:
commit
888d1b9d36
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue