Hey all, Watir.wait() listens to whether IE thinks its done loading, and then checks to see that the main document and any sub documents/frames have finished loading. More and more, there are pages that on load also kick off various XHRs <http://en.wikipedia.org/wiki/XMLHttpRequest> and timers<http://www.w3schools.com/js/js_timing.asp>. For me - and possibly for a growing number of folks, testing more AJAXy applications - it would be great to expand wait() to check if there are any XHRs or timers pending, in additional to the checks it currently makes.
Several questions: 1. Do you think that expanding wait() to check that all pending XHRs and timers are complete would be a useful change in Watir itself (either in general or as an option for some users)? Or do you think that the problem I'm describing is better solved another way? (Would this be a valuable addition to Watir?) 2. What would one need to do to get wait() to wait for XHRs and timers? How difficult do you think this would be to add to Watir? 3. If the changes I'm suggesting don't make sense for watir (e.g. harmful for some users, more difficult to implement than it's worth,...) another alternative I've been discussing with developers here is adding a JS function that my scripts could call. This could be either (A) a function I would call every 0.2 seconds or so that would return true once all XHRs and timers were done, or (B) a JS function that I would call once that would wait for the page to reply that it was done executing all pending XHRs and timers. Any thoughts about which of these would be better / easier to implement? Thanks for your thoughts, Jeff -- http://testingjeff.wordpress.com
_______________________________________________ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general