I'm interacting with a JavaScript-heavy website which uses SignalR polling. This usually causes Watir-Webdriver to time out after loading a page.
I've managed partial success by appending the command:
driver.execute_script '$.connection.hub.stop();'
to every page navigation instruction, like goto or click.
However this doesn't work in every instance, as I think the polling sometimes starts just after the page loads. In some cases the polling is triggered by selecting a radio button or checkbox as well.
Is there a reliable way of handling polling, other than having to use Timeout and revisiting the page after each failure?