Check for element to be clickable without an explicit wait time Check for element to be clickable without an explicit wait time selenium selenium

Check for element to be clickable without an explicit wait time


Answered a similar question here the other day. This method waits for the page to be loaded before returning true. So your elements should be clickable then.

private static WebDriverWait wait = new WebDriverWait(driver, 60);private static JavascriptExecutor js  = (JavascriptExecutor) driver;public static void waitForPageLoaded() {            wait.until(new ExpectedCondition<Boolean>() {                public Boolean apply(WebDriver driver) {                    Boolean res = (js.executeScript("return document.readyState").equals("complete"));                    System.out.println("[DEBUG] waitForPageLoaded: " + res);                    return res;            }    });}