Encountering intermittent errors with certain java selenium-rc tests that seem to be linked to a page containing an ajax poll that refreshes automatically upon meeting specific server conditions. Selenium doesn't have the capability to wait for the page to fully load, resulting in various "Couldn't access document.body" errors.
Is there a way to handle this situation gracefully in selenium? Or could there be a method to identify if the user is using selenium from the page's javascript and disable the automatic refresh?
For reference, here is a snippet of the javascript code on the page...
var ajax = new Ajax(url, {
update: state,
method: 'get',
onComplete: function(message) {
if (some_condition) {
window.location.replace(unescape(window.location));
}
}
});