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

后端 未结 2 410
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-09 03:45

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 webpag

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-09 04:44

    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
    

提交回复
热议问题