Timeout on javascript form only running Cucumber on Jenkins
Asked Answered
A

1

3

I'm running Cucumber 1.2.1 with Watir-webdriver 0.6.1 to test a webpage.

Locally all the test run ok, but when trying to launch them on a CI machine (Jenkins) i have a timeout when filling a javascript form. I have a email and password textfields but Cucumber is unable to fill them. A couple of times, after two minutes, only the email textfiels has been filled...

The javascript form opens correctly. This is the link that opens it:

`<a id="user_popup" class="textuser_popup" url="/en/bla/" href="javascript:void(0);" trackclick="click/unlogged/test/test/login" rel="nofollow"  gaclick="/en/bla/homepage/click:header-section>login">Sign in</a>`

Once the form is loaded, the code for the email and password is:

<ul class="signin">
<li class="reg_form">
<label class="reg_form_label">Your email</label>
<input id="yourEmail" class="l_email" type="text" value="" name="email">
</li>
<li class="password_area">
<label class="reg_form_label">Your password</label>
<input id="yourPassword" class="l_password" type="password" name="password">
</li>
</ul>

I use PageObject but calling the element directly on the step doesnt work either. This is how i fill the fields:

@browser.text_field(:id, "yourEmail").set("[email protected]")
@browser.text_field(:id, "yourPassword").set("thePass")

Finally, the error is:

execution expired (Timeout::Error)
/usr/lib/ruby/1.8/timeout.rb:64:in `rbuf_fill'
/usr/lib/ruby/1.8/net/protocol.rb:134:in `rbuf_fill'
/usr/lib/ruby/1.8/net/protocol.rb:116:in `readuntil'
/usr/lib/ruby/1.8/net/protocol.rb:126:in `readline'
/usr/lib/ruby/1.8/net/http.rb:2028:in `read_status_line'
/usr/lib/ruby/1.8/net/http.rb:2017:in `read_new'
/usr/lib/ruby/1.8/net/http.rb:1051:in `request'
/usr/lib/ruby/1.8/net/http.rb:1037:in `request'
/usr/lib/ruby/1.8/net/http.rb:543:in `start'
/usr/lib/ruby/1.8/net/http.rb:1035:in `request'

When launching the test locally, it works absolutely fine. Don't know why fails when running remotely. The remote browser (usually runs on headless mode but i opened a X11 session to view the execution) is Firefox ESR 10.0.8 and the OS a CentOS.

Do you have any suggestion about what's happening, please? If you need more info about the problem, just ask.

Any advise is welcome :)

Autotoxin answered 18/10, 2012 at 10:6 Comment(0)
V
1

I had the same problem, I added the following line of code in my env.rb file and its working fine now.

client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = 300 # seconds – default is 60
$browser = Watir::Browser.new :firefox, :http_client => client
Vitrification answered 19/10, 2012 at 14:0 Comment(2)
Thanks for the tip! it works but its not acceptable to take 9 minutes (!!) to fill two textfields. Still wondering where the problem is; maybe an extremely slow execution of command_processor.js when the pop-up appears...Accentuation
still getting timeouts after this. and as Jano mentionned, this does not really solved the problem, only waits longer...Hoiden

© 2022 - 2024 — McMap. All rights reserved.