public void waitForPageLoaded() {
WebDriver driver = DriverFactory.getWebDriver()
ExpectedCondition<Boolean> expectation = new
ExpectedCondition<Boolean>() {
public Boolean apply(WebDriver driver) {
return ((JavascriptExecutor) driver).executeScript("return document.readyState").toString().equals("complete");
}
};
try {
Thread.sleep(1000);
WebDriverWait wait = new WebDriverWait(driver, 30);
wait.until(expectation);
} catch (Throwable error) {
Assert.fail("Timeout waiting for Page Load Request to complete.");
}
}
i want to user this code to create a custom keyword ,but failed
error
Multiple markers at this line
- Groovy:class Keyword is not an annotation in @Keyword
- Groovy:unable to resolve class Keyword , unable to find class for
please help ,thanks