Created
January 29, 2020 19:59
-
-
Save brobles82/ded9290db2e982ed4a315cd162fada56 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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