我在60秒后出现此错误,因为页面尚未完成,在60秒内加载
我执行的代码
b.element(:id,'Finish').click
60秒后抛出以下错误
C:/Ruby23/lib/ruby/2.3.0/net/protocol.rb:158:in `rbuf_fill': Net::ReadTimeout (Net::ReadTimeout)
from C:/Ruby23/lib/ruby/2.3.0/net/protocol.rb:136:in `readuntil'
from C:/Ruby23/lib/ruby/2.3.0/net/protocol.rb:146:in `readline'
from C:/Ruby23/lib/ruby/2.3.0/net/http/response.rb:40:in `read_status_line'
from C:/Ruby23/lib/ruby/2.3.0/net/http/response.rb:29:in `read_new'
from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:1437:in `block in transport_request'
from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:1434:in `catch'
from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:1434:in `transport_request'
from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:1407:in `request'
from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:1400:in `block in request'
from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:853:in `start'
from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:1398:in `request'
所以我把它包含在我的程序中
client = Selenium::WebDriver::Remote::Http::Default.new
client.read_timeout = 120 # seconds
b=Watir::Browser.new :firefox, desired_capabilities: caps,profile: "default", http_client: client
但它仍然有效,
然后我包含了这段代码
browser.driver.manage.timeouts.page_load = 180
无论我做什么,它总是在60秒后失败,为什么会这样?
我把这个问题放在了一般性问题上,但到目前为止还没有答案。