I have been getting a Timeout error ever since I started developing my tests. At first I thought it was related to the efficiency of my xpaths but after seeing the test pass quickly numerous times I don't think it is related to the selectors. The error randomly occurs and often when it does it occurs multiple times within a feature. I need to fix or at least understand what this problem is.
An example of a step definition:
When /^I navigate to "(.*)"$/ do |webpage|
navigate_to(webpage)
end
This is the error I get:
Timeout::Error (Timeout::Error)
/usr/lib/ruby/1.9.1/net/protocol.rb:146:in `rescue in rbuf_fill'
/usr/lib/ruby/1.9.1/net/protocol.rb:140:in `rbuf_fill'
/usr/lib/ruby/1.9.1/net/protocol.rb:122:in `readuntil'
/usr/lib/ruby/1.9.1/net/protocol.rb:132:in `readline'
/usr/lib/ruby/1.9.1/net/http.rb:2562:in `read_status_line'
/usr/lib/ruby/1.9.1/net/http.rb:2551:in `read_new'
/usr/lib/ruby/1.9.1/net/http.rb:1319:in `block in transport_request'
/usr/lib/ruby/1.9.1/net/http.rb:1316:in `catch'
/usr/lib/ruby/1.9.1/net/http.rb:1316:in `transport_request'
/usr/lib/ruby/1.9.1/net/http.rb:1293:in `request'
/usr/lib/ruby/1.9.1/net/http.rb:1286:in `block in request'
/usr/lib/ruby/1.9.1/net/http.rb:745:in `start'
/usr/lib/ruby/1.9.1/net/http.rb:1284:in `request'
./features/support/env.rb:88:in `block in get_page_url'
The env.rb :
require 'selenium-webdriver'
require 'rubygems'
require 'nokogiri'
require 'rspec'
require 'rspec/expectations'
require 'httpclient'
require 'fileutils.rb'
require 'pathname'
$driver = Selenium::WebDriver.for :ie
#accept_next_alert = true
$driver.manage.timeouts.implicit_wait = 300
$driver.manage.timeouts.script_timeout = 300
$driver.manage.timeouts.page_load = 300
#verification_errors = []
AfterStep do
sleep 5
end
at_exit do
$driver.close
end
I have gone through numerous questions about this very same topic and none seem to have an answer that works, if an answer at all.
Similar issue. I have tried the solutions provided here but my error still persist https://www.ruby-forum.com/topic/4414675
I have tried adding explicit waits as such: http://docs.seleniumhq.org/docs/04_webdriver_advanced.jsp
I need to get this issue sorted out so please ask questions if I wasn't clear on anything.
Here is a list of installed gems:
archive-tar-minitar (0.5.2)
bigdecimal (1.1.0)
builder (3.2.0)
bundler (1.3.5)
childprocess (0.3.9)
columnize (0.3.6)
commonwatir (4.0.0)
cucumber (1.2.3)
debugger-linecache (1.2.0)
debugger-ruby_core_source (1.2.2)
diff-lcs (1.2.1)
ffi (1.5.0, 1.0.9)
gherkin (2.11.6)
hoe (3.6.2)
httpclient (2.3.2)
io-console (0.3)
json (1.7.7)
linecache19 (0.5.12)
mime-types (1.23)
mini_magick (3.6.0)
mini_portile (0.5.0)
minitest (2.12.1, 2.5.1)
multi_json (1.7.1)
nokogiri (1.5.9)
rack (1.5.2)
rack-test (0.6.2)
rake (10.0.3, 0.9.6)
rautomation (0.9.2)
rb-readline (0.5.0)
rdoc (3.12.1)
rspec (2.13.0)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
rspec-mocks (2.13.0)
ruby-debug-base19 (0.11.25)
ruby-debug19 (0.11.6)
ruby_core_source (0.1.5)
rubygems-update (2.0.3)
rubyzip (0.9.9)
s4t-utils (1.0.4)
selenium-webdriver (2.33.0, 2.31.0)
subexec (0.2.3)
user-choices (1.1.6.1)
watir (4.0.2)
watir-classic (3.7.0)
watir-webdriver (0.6.2)
websocket (1.0.7)
win32-api (1.4.8)
win32-process (0.7.2)
win32screenshot (1.0.8)
windows-api (0.4.2)
windows-pr (1.2.2)
xml-simple (1.1.2)
xpath (2.0.0)