cartodb-4.42/spec/support/selenium_find_patch.rb

15 lines
556 B
Ruby
Raw Normal View History

2024-04-06 13:25:13 +08:00
# REMOVE THIS FILE WHEN
# http://code.google.com/p/selenium/issues/detail?id=2287
# http://code.google.com/p/selenium/issues/detail?id=2099
# GET FIXED
class Capybara::Selenium::Driver
def find(selector)
begin
browser.find_elements(:xpath, selector).map { |node| Capybara::Selenium::Node.new(self, node) }
rescue Selenium::WebDriver::Error::InvalidSelectorError, Selenium::WebDriver::Error::UnhandledError
sleep 1
browser.find_elements(:xpath, selector).map { |node| Capybara::Selenium::Node.new(self, node) }
end
end
end