smart stuff

Using Selenium to test asynchronous calls
19 Feb 06 - http://www.approximity.com/cgi-bin/blogtariAgile/index.rb/Ruby/Rails/selenium_ajax.rdoc
Great read
 >Luckily, Selenium has a feature that is horribly documented: waitForValue,
 >which you can use in the test case directly, and waitForCondition,
 >callable in a JavaScript-based extension. Using a combination of these,
 >you can make your Ajax call and wait for any condition that should happen,
 >such as the DOM changing or values updating.