0

在我的场景结束时,Capybara 会自动尝试去file:/ruby193/lib/ruby/gems/1.9.1/gems/capybara-2.2.0/lib/capybara/empty.html,我该如何阻止它?

我正在使用 BrowserStack 服务,因此该文件在浏览器实际运行的虚拟机上不存在,因此会显示一个 windows 错误弹出窗口,我得到一个Timeout::Error (Timeout::Error).

添加结果:

C:/ruby193/lib/ruby/1.9.1/net/protocol.rb:146:in `rescue in rbuf_fill': Timeout::Error (Timeout::Error)
        from C:/ruby193/lib/ruby/1.9.1/net/protocol.rb:140:in `rbuf_fill'
        from C:/ruby193/lib/ruby/1.9.1/net/protocol.rb:122:in `readuntil'
        from C:/ruby193/lib/ruby/1.9.1/net/protocol.rb:132:in `readline'
        from C:/ruby193/lib/ruby/1.9.1/net/http.rb:2563:in `read_status_line'
        from C:/ruby193/lib/ruby/1.9.1/net/http.rb:2552:in `read_new'
        from C:/ruby193/lib/ruby/1.9.1/net/http.rb:1320:in `block in transport_request'
        from C:/ruby193/lib/ruby/1.9.1/net/http.rb:1317:in `catch'
        from C:/ruby193/lib/ruby/1.9.1/net/http.rb:1317:in `transport_request'
        from C:/ruby193/lib/ruby/1.9.1/net/http.rb:1294:in `request'
        from C:/ruby193/lib/ruby/1.9.1/net/http.rb:1287:in `block in request'
        from C:/ruby193/lib/ruby/1.9.1/net/http.rb:746:in `start'
        from C:/ruby193/lib/ruby/1.9.1/net/http.rb:1285:in `request'
        from C:/ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.37.0/lib/selenium/webdriver/remote/http/default.rb:83:in `response_for'
        from C:/ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.37.0/lib/selenium/webdriver/remote/http/default.rb:39:in `request'
        from C:/ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.37.0/lib/selenium/webdriver/remote/http/common.rb:40:in `call'
        from C:/ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.37.0/lib/selenium/webdriver/remote/bridge.rb:634:in `raw_execute'
        from C:/ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.37.0/lib/selenium/webdriver/remote/bridge.rb:612:in `execute'
        from C:/ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.37.0/lib/selenium/webdriver/remote/bridge.rb:200:in `quit'
        from C:/ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.37.0/lib/selenium/webdriver/common/driver.rb:168:in `quit'
        from C:/ruby193/lib/ruby/gems/1.9.1/gems/capybara-2.2.0/lib/capybara/selenium/driver.rb:152:in `quit'
        from C:/ruby193/lib/ruby/gems/1.9.1/gems/capybara-2.2.0/lib/capybara/selenium/driver.rb:19:in `block in browser'
4

1 回答 1

1

我最终将位于的 driver.rb 文件lib\ruby\gems\1.9.1\gems\capybara-2.2.0\lib\capybara\selenium\driver.rb更改为将行更改@browser.navigate.to(uri.to_s)@browser.navigate.to("about:help"). 我知道他们出于某种原因将其更改为使用该文件。

于 2013-12-16T11:49:19.657 回答