Net::ReadTimeout (Net::ReadTimeout) Selenium Ruby
Another option to use RSpec::Retry which adds a retry option for intermittently failing specs.
require 'rspec/retry'RSpec.configure do |config| # show retry status in spec process config.verbose_retry = true # Try twice (retry once) config.default_retry_count = 2 # Only retry when Selenium raises Net::ReadTimeout config.exceptions_to_retry = [Net::ReadTimeout]end
The default timeout is 60 seconds. One thing to try is to adjust the internal timeout to see if that fixes it:
Capybara.register_driver :selenium do |app| profile = Selenium::WebDriver::Firefox::Profile.new client = Selenium::WebDriver::Remote::Http::Default.new client.timeout = 120 # instead of the default 60 Capybara::Selenium::Driver.new(app, browser: :firefox, profile: profile, http_client: client)end