Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Net::ReadTimeout (Net::ReadTimeout) Selenium Ruby

I've seen a few posts related to timeout errors within Selenium. This is becoming more and more unbearable as it's rendering my test pack unusable. I'm testing a webpage currently in development.

I have a regression suite of around 300 test scenarios which has always worked until the latest update to firefox and selenium webdriver. Now for almost every other test i'm getting:

Net::ReadTimeout (Net::ReadTimeout) errors.

This can't be coincidence. Would anyone know of what could be causing the sudden timeout problems? I've tried going back to previous versions of webdriver and firefox.

like image 305
Tom Avatar asked Oct 14 '14 07:10

Tom


1 Answers

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
like image 142
Jay Prall Avatar answered Nov 10 '22 10:11

Jay Prall