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

查看:602
本文介绍了Net :: ReadTimeout(Net :: ReadTimeout)Selenium Ruby的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看过一些与Selenium中超时错误相关的帖子。这正变得越来越难以承受,因为它使我的测试包不可用。我正在测试一个目前正在开发的网页。



我有一个大约300个测试场景的回归套件,它们一直工作到firefox和selenium webdriver的最新更新。现在几乎所有其他测试我得到:



Net :: ReadTimeout(Net :: ReadTimeout)错误。



这不可能是巧合。有人知道什么可能会导致突发的超时问题?我试过回到以前的webdriver和firefox版本。

解决方案

默认超时为60秒。有一件事要调整内部超时,看看是否能修复它:

  Capybara.register_driver:selenium do | app | 
profile = Selenium :: WebDriver :: Firefox :: Profile.new
client = Selenium :: WebDriver :: Remote :: Http :: Default.new
client.timeout = 120#instead的默认值60
Capybara :: Selenium :: Driver.new(app,browser::firefox,profile:profile,http_client:client)
end
/ pre>

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.

解决方案

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

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

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