title: Selenium waiting for AJAX in Chrome
body: <p>I've been using Selenium to automate website testing. Part of the tests involves waiting for AJAX requests to finish. I've been using this line to do that with jQuery 1.4:</p>
  
  <pre><code>selenium.WaitForCondition("selenium.browserbot.getCurrentWindow().jQuery.active == 0", "5000");
  </code></pre>
  
  <p>It worked fine in Chrome and Firefox 4, but not IE9. Then I upgraded to jQuery 1.5, and it magically stopped working in Chrome. I've tried the following variations, but none of them work:</p>
  
  <pre><code>selenium.WaitForCondition("selenium.browserbot.getCurrentWindow().jQuery.active == 0", "5000");
  selenium.WaitForCondition("selenium.browserbot.getCurrentWindow().jQuery.ajax.active == 0", "5000");
  selenium.WaitForCondition("selenium.browserbot.getCurrentWindow().$.active == 0", "5000");
  selenium.WaitForCondition("selenium.browserbot.getCurrentWindow().$.ajax.active == 0", "5000");
  </code></pre>
  
  <p>The SeleniumException is that it cannot read property <code>active</code> or <code>ajax</code> of undefined, so I guess it's somehow not able to get to jQuery. My colleague is running the same tests on Firefox 4, and they pass.</p>
  
  <p>Has anyone experienced this issue? Any suggestions?</p>