selenium動態等待方法

public void waitForLoad(final By elementBy) {
        WebDriverWait wait = (new WebDriverWait(driver, 30));
        wait.until(new ExpectedCondition<Boolean>() {
            public Boolean apply(WebDriver d) {
                boolean loadcomplete = d.findElement(elementBy).isDisplayed();
                return loadcomplete;
            }
        });
    }
相關文章
相關標籤/搜索