Selenium and Ajax Requests

Mon Nov 05 00:00:00 -0800 2007

It happens to all programmers sooner or later: you sink a day into trying to save a couple seconds, and afterwards your only hope of making it all worthwhile is to share your findings.

I desperately needed to test my Rails AJAX behaviors, so yesterday I dug in and learned Selenium. For Rails integration I decided to work with SeleniumOnRails.

Bit of a learning curve there. Eventually I figured out how to speak Selenese, how to patch selenium-on-rails to clear the fixture cache, and how to rebuild my Solr index after reloading fixtures. Things were finally going well. But I had one problem left: asynchronous AJAX.