waitForPageLoad not really waiting for the page to finish loading

Annoying, right?

The question is, what does page load actually mean? In effect, it’s the resources identified by the HTML document (including the HTML itself, images, JavaScript and CSS). Problem then becomes, if the page sends requests to the server for more resources (ajax calls for example) the page isn’t actually “ready” even though it is technically “loaded.”

The cure:

Wait for a set of things unique to the page that should be present and visible. You could also add a fixed delay after that.

If you can nail that requirement for all your pages, you can say good bye to “is the page really ready” issues.

So, there is no one-shot command/API to solve this – the solution is in the (your) approach.

Hope that helps?

3 Likes