Skip to content

Instantly share code, notes, and snippets.

@brobles82
Created January 29, 2020 19:59
Show Gist options
  • Save brobles82/ded9290db2e982ed4a315cd162fada56 to your computer and use it in GitHub Desktop.
Save brobles82/ded9290db2e982ed4a315cd162fada56 to your computer and use it in GitHub Desktop.
public static void click(WebElement webElement) {
String source = driver.getPageSource();
WebDriverWait wait = new WebDriverWait(driver(), 30);
ExpectedCondition<Boolean> elementIsClickable = arg0 -> {
try {
webElement.click();
return !driver.getPageSource().equals(source);
} catch (Exception e) {
return false;
}
};
wait.until(elementIsClickable);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment