Watir WebDriver-page load complete

Using Watir WebDriver how to ensure that after clicking a link/button
downloading the result page is complete. It should include the ajax case

You need to look for an element which is only present once the load is
complete, for example, a table to become visible, or a button enabled.
As far as I know you can’t wait for all AJAX to complete, you need to
target a specific element.

In general, how can we handle the page load for multiple pages without
specifying a particular or specific single page element ?

For most web pages, watir-webdriver’s wait is implicit, so it should
wait until the page has loaded. If you want to wait for data to be
retrieved after the page has loaded, then you should be able to write a
generic wait statement which is then passed an object to wait for as a
variable, and have that variable defined by a case statement or similar
which could be determined by link content.

If you’re loading a page, then you want to do something with that
page… so you should already know the object that you want to interact
with. Look into watir-webdriver’s “wait” methods, i.e: