Our site runs a lot of JavaScript / jQuery in the function $ (document) .ready (), customizes buttons, loads content via ajax, etc. Selenium waits for the DOM to load, but then proceeds to testing until .ready () is complete.
The partial solution seems to use validation to check if the browser is waiting for pending ajax requests:
selenium.browserbot.getCurrentWindow().jQuery.active == 0
However, this does not guarantee that we are not yet setting bindings for buttons and things.
Any help would be greatly appreciated. The current βbestβ sentence adds an element to the page at the end of the .ready () method, which Selenium can catch as a signal to get started, but the idea of ββadding code like this for testing purposes seems fragmentary at best.
David smith
source share