lib/wildcard_finders/finders.rb in wildcard_finders-0.0.3 vs lib/wildcard_finders/finders.rb in wildcard_finders-0.0.4
- old
+ new
@@ -35,10 +35,14 @@
end
x.descendant(tag.to_sym)[attr_matcher.inject(&:&)]
end
- find(:xpath, xpath)
+ begin
+ find(:xpath, xpath)
+ rescue Capybara::ElementNotFound
+ nil
+ end
end
def self.method_added(name)
METHODS.push(name)
end