[wtr-general] Re: How to wait for javascript generated elements?

2012-03-07 Thread Dan Claudiu Pop
Yes, but other libraries should have similar options. For Prototype.js, you can use Ajax.activeRequestCount and so on. On Wednesday, March 7, 2012 5:08:27 AM UTC+2, Anthony Hallett wrote: @browser.execute_script(return jQuery.active == 0) will only report on javascripts generated from the

[wtr-general] Re: How to wait for javascript generated elements?

2012-03-06 Thread Dan Claudiu Pop
In case you have ajax requests you can use: @browser.execute_script(return jQuery.active == 0) The code keeps checking whether or not there is at least one active AJAX request. Put it in a while and you should be ok. Dan On Mar 5, 7:34 pm, cootcraig cr...@coot.net wrote: I'm using watir

[wtr-general] Re: How to wait for javascript generated elements?

2012-03-06 Thread Anthony Hallett
@browser.execute_script(return jQuery.active == 0) will only report on javascripts generated from the jQuery library ..useful if this is what your developers use but otherwise not. On Mar 6, 10:58 pm, Dan Claudiu Pop danclaudiu...@gmail.com wrote: In case you have ajax requests you can use:

[wtr-general] Re: How to wait for javascript generated elements?

2012-03-05 Thread cootcraig
On Mar 5, 10:34 am, cootcraig cr...@coot.net wrote: I'm using watir for the first time.  The site I'm working with generates the elements I need to interact with in JavaScript.  If I search for the element immediately it is not on the page, If I wait 20 seconds it is.  What is a good way to

[wtr-general] Re: How to wait for javascript generated elements?

2012-03-05 Thread Dave McNulla
Another more generic option is to ask the developers to place an invisible object on the page when the javascript completes, then wait_until_present for that. Dave On Monday, March 5, 2012 9:34:56 AM UTC-8, cootcraig wrote: I'm using watir for the first time. The site I'm working with