Net::ReadTimeout (Net::ReadTimeout) Selenium Ruby [英] Net::ReadTimeout (Net::ReadTimeout) Selenium Ruby

查看:13
本文介绍了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.

解决方案

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

这篇关于Net::ReadTimeout (Net::ReadTimeout) Selenium Ruby的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆