Skip to content


Testing jQuery Autocomplete using Capybara

This is a brilliant tip. I would never have worked this out on my own. Thank you Jack Russell Software Company.

http://jackhq.tumblr.com/post/3728330919/testing-jquery-autocomplete-using-capybara

The sleep commands were the critical bit, without them Selenium just wasn’t firing the JavaScript event handlers.

Here are the relevant lines from my integration test.
# We are looking for "Make Two"    
s.fill_in "Make", :with => "Make"
sleep 1
page.execute_script("$('.ui-menu-item a:contains(\"Make Two\")').trigger('mouseenter').click();")

Posted in Ruby-on-Rails, Software Development.

Tagged with , , , , .


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.



%d bloggers like this: