2012-11-01 218 views
1

我在加載較重的網頁時遇到了超時::錯誤問題。我觀察到,即使我添加了一個隱含的等待電話@driver.manage.timeouts.implicit_wait = 300,在300秒之前拋出超時錯誤 - 它會拋出大約60-70秒。超時加載重載頁面時出現硒錯誤頁面

會發生錯誤是 -

Timeout::Error 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/protocol.rb:146:in `rescue in rbuf_fill' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/protocol.rb:140:in `rbuf_fill' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/protocol.rb:122:in `readuntil' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/protocol.rb:132:in `readline' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/http.rb:2562:in `read_status_line' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/http.rb:2551:in `read_new' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/http.rb:1319:in `block in transport_request' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/http.rb:1316:in `catch' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/http.rb:1316:in `transport_request' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/http.rb:1293:in `request' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/http.rb:1286:in `block in request' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/http.rb:745:in `start' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/http.rb:1284:in `request' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/http/default.rb:82:in `response_for' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/http/default.rb:38:in `request' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/http/common.rb:40:in `call' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/bridge.rb:598:in `raw_execute' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/bridge.rb:576:in `execute' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/remote/bridge.rb:99:in `get' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/common/navigation.rb:14:in `to' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/common/driver.rb:108:in `get' 
backlot.rb:17:in `test_backlot' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/minitest/unit.rb:949:in `run' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/test/unit/testcase.rb:17:in `run' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/minitest/unit.rb:787:in `block in _run_suite' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/minitest/unit.rb:780:in `map' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/minitest/unit.rb:780:in `_run_suite' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/test/unit.rb:565:in `block in _run_suites' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/test/unit.rb:563:in `each' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/test/unit.rb:563:in `_run_suites' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/minitest/unit.rb:746:in `_run_anything' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/minitest/unit.rb:909:in `run_tests' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/minitest/unit.rb:896:in `block in _run' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/minitest/unit.rb:895:in `each' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/minitest/unit.rb:895:in `_run' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/minitest/unit.rb:884:in `run' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/test/unit.rb:21:in `run' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/test/unit.rb:326:in `block (2 levels) in autorun' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/test/unit.rb:27:in `run_once' 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/test/unit.rb:325:in `block in autorun' 

回答

0

嘗試使用寶石fakeweb
FakeWeb是用Ruby僞造Web請求的輔助工具。它在全球範圍內工作,無需修改代碼或編寫大量存根。

在Gemfile中寫
寶石 'fakeweb':需要=>假

需要 'fakeweb' 在你的文件
希望這會工作
使用上述說法..

+0

由於它的工作!但我只是對Gemfile進行了修改 - gem'fakeweb',:require => false&我沒有添加 - 在我的文件中需要'fakeweb'。它仍然有效。 – TDHM

+0

已接受。我是堆棧溢出新手,並沒有意識到這一點。 – TDHM