I have done this in the past...<br><br>def wait_for_ajax(timeout = 30000)<br>&nbsp; wait_for_condition &quot;window.Ajax.activeRequestCount == 0&quot;, timeout<br>end<br>&nbsp; <br>def wait_for_effects(timeout = 30000)<br>&nbsp; wait_for_condition &quot;window.Effect.Queue.size() == 0&quot;, timeout<br>
end<br><br>Mark<br><br><div class="gmail_quote">On Wed, Apr 16, 2008 at 3:57 PM, Andy Watts &lt;<a href="mailto:andywatts@yahoo.com">andywatts@yahoo.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Hi,<br>
<br>
I&#39;ve got a story working with selenium-rc, but am stuck writing ajax-aware<br>
steps.<br>
<br>
How are people coding their story steps to wait for an Ajax event to<br>
complete?<br>
<br>
<br>
Here&#39;s what I&#39;ve looked at so far.<br>
<br>
$browser.wait_for_element_present<br>
Looks Ideal, but not in selenium-ruby-client-drivers for some reason.<br>
<br>
def wait_for_ajax<br>
<br>
$browser.wait_for_condition(&quot;selenium.browserbot.getCurrentWindow().ServerConnection.isPending()<br>
== false&quot;, 2000)<br>
end<br>
This helper looked promising, but it returns<br>
SeleniumCommandError:<br>
selenium.browserbot.getCurrentWindow().ServerConnection has no properties<br>
<br>
Many Thanks<br>
Andy<br>
<font color="#888888"><br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://www.nabble.com/Story-runner-%2B-selenium-rc-%2B-wait_for_xxxx-tp16732279p16732279.html" target="_blank">http://www.nabble.com/Story-runner-%2B-selenium-rc-%2B-wait_for_xxxx-tp16732279p16732279.html</a><br>

Sent from the rspec-users mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
rspec-users mailing list<br>
<a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/rspec-users" target="_blank">http://rubyforge.org/mailman/listinfo/rspec-users</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Mark Van Holstyn, Partner / Software Developer<br><a href="mailto:mvanholstyn@mutuallyhuman.com">mvanholstyn@mutuallyhuman.com</a>, (616) 706-6842<br>Mutually Human Software, <a href="http://mutuallyhuman.com">http://mutuallyhuman.com</a>