0

I'm testing a web application using page-object gem with selenium Webdriver.

In the home page [Start page] I have a few RSpec verifications. But I'm getting the following error instead of the RSpec exception:

>Timeout::Error (Timeout::Error)
C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:146:in `rescue in rbuf_fill'
C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:140:in `rbuf_fill'
C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:122:in `readuntil'
C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:132:in `readline'
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:2562:in `read_status_line'
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:2551:in `read_new'
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1319:in `block in transport_request'
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1316:in `catch'
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1316:in `transport_request'
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1293:in `request'
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1286:in `block in request'
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:745:in `start'

Does anyone facing this issue?

Justin Ko
  • 46,526
  • 5
  • 91
  • 101
NMKP
  • 789
  • 3
  • 11
  • 33

1 Answers1

0

I am not familiar with ruby, and without the code it is hard to answer. But here comes my guess:

Selenium uses the concept of explicit and implicit waits when you try to access a DOM element. So I guess that you use some sort of selector on the element in question and then selenium tries to find it. It seems to be not present and as a result the Timeout is thrown. The behavior is expected.

luksch
  • 11,497
  • 6
  • 38
  • 53
  • If the element is not present in the page I should get appropriate error message. [element not present]This error message is something strange for me. – NMKP Oct 09 '13 at 08:36
  • Well, maybe I am wrong, but you did not show the relevant code parts, so all I can do is guessing. – luksch Oct 09 '13 at 09:31
  • class StartPage include PageObject page_url "#{URL}" link :login, :link => "Sign IN" expected_element :login end This is the start page code. I'm getting the error in the expected element line. It supposed to throw element not present. but I'm getting Timeout error. – NMKP Oct 09 '13 at 09:37