I am continuously getting an irritating error :


C:\Documents and Settings\rakshiar\My
Documents\userdata\Ruby\Scripts>So.rb
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:2562:in
`read_status_line'
        from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:2551:in `read_new'
        from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1319:in `block in
transport_r
equest'
        from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1316:in `catch'
        from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1316:in
`transport_request'
        from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1293:in `request'
        from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1286:in `block in
request'
        from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:745:in `start'
        from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1284:in `request'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.30.0/lib/s
elenium/webdriver/remote/http/default.rb:83:in `response_for'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.30.0/lib/s
elenium/webdriver/remote/http/default.rb:39:in `request'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.30.0/lib/s
elenium/webdriver/remote/http/common.rb:40:in `call'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.30.0/lib/s
elenium/webdriver/remote/bridge.rb:615:in `raw_execute'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.30.0/lib/s
elenium/webdriver/remote/bridge.rb:593:in `execute'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.30.0/lib/s
elenium/webdriver/remote/bridge.rb:358:in `clickElement'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.30.0/lib/s
elenium/webdriver/common/element.rb:54:in `click'
        from C:/Documents and Settings/rakshiar/My
Documents/userdata/Ruby/Scrip
ts/So.rb:75:in `<main>'

C:\Documents and Settings\rakshiar\My
Documents\userdata\Ruby\Scripts>gem --h
ERROR:  Invalid option: --h.  See 'gem --help'.

C:\Documents and Settings\rakshiar\My Documents\userdata\Ruby\Scripts>

Code to handle this:

begin
  elem = wait.until { driver.title == "Condition View Page"}
  driver.find_element(:name,'btnDone').click
rescue Timeout::Error,Selenium::WebDriver::Error::NoSuchElementError =>
e
  retry
end

But no luck. What should I do? Why the error is not being rescued? What
should I fix in my code?

Thanks

-- 
Posted via http://www.ruby-forum.com/.