watir/watir-webdriver — Issue #119: Error trying to change default timeout
Author: charlesmeyer101
Created: 2012-01-27 00:08:33+00:00
State: open

I am having difficulty where Watir-Webdriver is timing out after 60 seconds waiting for a very slow page to load. I am attempting to run the following code to change the default internal timeout value:

require 'watir-webdriver'

client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = 120 # seconds
driver = Selenium::WebDriver.for(:remote, :http_client => client)

but when this code is run it generates the following error:

/Users/Charles/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/http.rb:644:in `initialize': Connection refused - connect(2) (Errno::ECONNREFUSED)
from /Users/Charles/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/http.rb:644:in `open'
from /Users/Charles/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/http.rb:644:in `block in connect'
from /Users/Charles/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/timeout.rb:58:in `timeout'
from /Users/Charles/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/timeout.rb:89:in `timeout'
from /Users/Charles/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/http.rb:644:in `connect'
from /Users/Charles/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/http.rb:637:in `do_start'
from /Users/Charles/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/http.rb:626:in `start'
from /Users/Charles/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/http.rb:1168:in `request'
from /Users/Charles/.rvm/gems/ruby-1.9.2-p290/gems/selenium-webdriver-2.15.0/lib/selenium/webdriver/remote/http/default.rb:81:in `response_for'
from /Users/Charles/.rvm/gems/ruby-1.9.2-p290/gems/selenium-webdriver-2.15.0/lib/selenium/webdriver/remote/http/default.rb:43:in `request'
from /Users/Charles/.rvm/gems/ruby-1.9.2-p290/gems/selenium-webdriver-2.15.0/lib/selenium/webdriver/remote/http/common.rb:39:in `call'
from /Users/Charles/.rvm/gems/ruby-1.9.2-p290/gems/selenium-webdriver-2.15.0/lib/selenium/webdriver/remote/bridge.rb:450:in `raw_execute'
from /Users/Charles/.rvm/gems/ruby-1.9.2-p290/gems/selenium-webdriver-2.15.0/lib/selenium/webdriver/remote/bridge.rb:92:in `create_session'
from /Users/Charles/.rvm/gems/ruby-1.9.2-p290/gems/selenium-webdriver-2.15.0/lib/selenium/webdriver/remote/bridge.rb:68:in `initialize'
from /Users/Charles/.rvm/gems/ruby-1.9.2-p290/gems/selenium-webdriver-2.15.0/lib/selenium/webdriver/common/driver.rb:33:in `new'
from /Users/Charles/.rvm/gems/ruby-1.9.2-p290/gems/selenium-webdriver-2.15.0/lib/selenium/webdriver/common/driver.rb:33:in `for'
from /Users/Charles/.rvm/gems/ruby-1.9.2-p290/gems/selenium-webdriver-2.15.0/lib/selenium/webdriver.rb:60:in `for'
from timeout_test.rb:5:in `

'

Thanks for considering this.