Instead of sleep
publicvoidclickOntaskType() {
getDriver().findElement(By.id("tasktypelink")).click();
sleep(500);
}
Prefer this fluentWait
publicvoidclickOntaskType() {
getDriver().findElement(By.id("tasktypelink")).click();
SeleniumUtil.fluentWait(By.name("handle"), getDriver());
}
It’s more robust, deterministic, in case of element not found… the exception will be clearer.
Another alternative is
(newWebDriverWait(driver,30)).until(newExpectedCondition() {
publicBoolean apply(WebDriver d) {
returnd.getTitle().toLowerCase().startsWith("Awesome Tester");