kazurayam / chromedriverfactory

A Java library that enables you to launch Selenium ChromeDriver using an existing user Profile. That let you to carry cookies over multiple HTTP sessions via user Profile.
0 stars 0 forks source link

want to wait for a page is loaded completely then ... #12

Closed kazurayam closed 2 years ago

kazurayam commented 2 years ago

I need a new method

ChromeDriverFactory#setWaitSeconds(Integer waitSeconds)
kazurayam commented 2 years ago

I do not really understand how the implicit wait works.

kazurayam commented 2 years ago

The following snippet would be better to make sure page is loaded and ready

void waitForLoad(WebDriver driver) {
    new WebDriverWait(driver, 30).until((ExpectedCondition<Boolean>) wd ->
            ((JavascriptExecutor) wd).executeScript("return document.readyState").equals("complete"));
}

Quote from https://stackoverflow.com/questions/15122864/selenium-wait-until-document-is-ready

kazurayam commented 2 years ago

I should not use the Implicit wait.

I should rather use pageLoadTimeout()