How to wait for page to load completely using JavaScript in Selenium
I'm trying get for page to load completely before doing an action. I don't want to start an action while loading circle on the browser tab is still turning. My wait for ajax function is not working for some cases, especially for new page loading. My function is JQuery based: JavascriptExecutor jsDriver = (JavascriptExecutor) webDriver; boolean stillRunningAjax = (Boolean) jsDriver .executeScript("return window.jQuery != undefined && jQuery.active != 0"); return !stillRunningAjax; if that comes false, running it again. But for page loading, after it returns true, browser is still loading (loadi
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.