我希望有人可以帮助我解决我在运行黄瓜测试时遇到的问题。
我收到以下错误:
Timeout::Error (Timeout::Error)
C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:146:in `rescue in rbuf_fill'
C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:140:in `rbuf_fill'
C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:122:in `readuntil'
C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:132:in `readline'
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:2562:in `read_status_line'
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:2551:in `read_new'
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1319:in `block in transport_request'
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1316:in `catch'
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1316:in `transport_request'
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1293:in `request'
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1286:in `block in request'
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:745:in `start'
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1284:in `request'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/http/default.rb:82:in `response_for'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/http/default.rb:38:in `request'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/http/common.rb:40:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/bridge.rb:598:in `raw_execute'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/bridge.rb:576:in `execute'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/bridge.rb:242:in `getScreenshot'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb:34:in `screenshot_as'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb:18:in `block in save_screenshot'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb:18:in `open'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb:18:in `save_screenshot'
有谁知道是什么原因造成的?
此错误在我的测试套件执行期间随机发生。在套件中,我将有大约 150 个场景,我已经看到这个错误发生在不同的阶段。例如,可能发生在场景 50 或场景 100。我通过来自 Jenkins 的 rake 文件或通过 cmd 窗口运行我的测试,但如果我使用任何一种方法都会发生错误。
我们这里的测试站点可能有点不稳定,而且这里可能会出现奇怪的超时,这可能是意料之中的。但是,一旦此错误开始发生,该错误发生的测试之后的所有其他测试都将出现相同的问题。我的场景都不是相互依赖的。每个场景通常都从一个步骤开始I go to the homepage
——在我的.rb
文件中的这一步中,我已经@browser.cookies.clear
包含了,因此前一个场景中应该没有剩余的数据。
有没有其他人遇到过这种情况,如果有,您采取了哪些步骤对其进行排序?