Can't set PageLoad of ChromeDriver instance Can't set PageLoad of ChromeDriver instance selenium selenium

Can't set PageLoad of ChromeDriver instance


i used this code which worked for me in both chrome and firefox. PageObject is my class and waitPageToLoad is my method.

public class PageObject {    protected Logger log = LogManager.getLogger(this.getClass().getName());    protected WebDriver driver;    protected WebDriverWait wait;  public WebDriver getDriver() {    log.debug("obtaining the driver object for current thread");    return driver;}  public WebDriverWait getWait() {    log.debug("obtaining the wait object for current thread");    return wait;} public void initialise(Object obj) {    PageFactory.initElements(getDriver(), obj);} public PageObject waitPageToLoad() {        domLoaded();        jqueryLoaded();        return this;    } public void domLoaded() {        log.debug("checking that the DOM is loaded");        final JavascriptExecutor js = (JavascriptExecutor) getDriver();        Boolean domReady = js.executeScript("return document.readyState").equals("complete");        if (!domReady) {            getWait().until(new ExpectedCondition<Boolean>() {                public Boolean apply(WebDriver d) {                    return (js.executeScript("return document.readyState").equals("complete"));                }            });        }    }  private void jqueryLoaded() {        log.debug("checking that any JQuery operations complete");        final JavascriptExecutor js = (JavascriptExecutor) getDriver();        if ((Boolean) js.executeScript("return typeof jQuery != 'undefined'")) {            boolean jqueryReady = (Boolean) js.executeScript("return jQuery.active==0");            if (!jqueryReady) {                getWait().until(new ExpectedCondition<Boolean>() {                    public Boolean apply(WebDriver d) {                        return (Boolean) js.executeScript("return window.jQuery.active === 0");                    }                });            }        }    }}


can you try

driver.manage().timeouts().implicitlyWait(10,timeunit.seconds)driver.manage().timeouts().pageLoadTimeout(10,timeunit.seconds)

And this is with selenium 3