Working on creating a custom PHP client for Selenium, I've encountered an issue with implementing the waitForPageToLoad()
function:
The problem lies in just checking the document.readyState
, as there could be JavaScript scripts running on the page (like animations triggered by button clicks) that should prolong the wait. This results in the document.readyState
returning a status of complete
before the actual loading is finished.
Additionally, using callbacks is not feasible as I cannot predict all the JavaScript that may run on the page. I am able to insert some JavaScript onto the page, but it must not interfere with its normal operation.
Any suggestions for a potential solution? Currently using the latest version of Firefox browser.
Thank you.