Can someone please give me a example of how to use rspec-retry with the selenium-webdriver. I am trying to get it to reattempt the navigation when there is a Net::ReadTimeout error. I found an example here but I am new to Ruby and don't think I am using it right.
What I have tried.
require 'selenium-webdriver'
require 'rspec/retry'
Selenium::WebDriver::PhantomJS.path = 'phantomjs.exe'
driver = Selenium::WebDriver.for :phantomjs
driver.manage.timeouts.page_load = 300
driver.navigate.to "http://google.com"
RSpec.configure do |config|
# show retry status in spec process
config.verbose_retry = true
# Try five times (retry 4 times)
config.default_retry_count = 5
# Only retry when Selenium raises Net::ReadTimeout
config.exceptions_to_retry = [Net::ReadTimeout]
end
puts(driver.title)
driver.quit