Skip to content

Instantly share code, notes, and snippets.

@seleniumgists
Created June 13, 2019 21:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seleniumgists/4cf438ba7386e2b4ecb556d731156f18 to your computer and use it in GitHub Desktop.
Save seleniumgists/4cf438ba7386e2b4ecb556d731156f18 to your computer and use it in GitHub Desktop.
generated automatically from #selenium on seleniumhq slack
public static ExpectedCondition<Boolean> dropDownToFinishExpanding(WebElementFacade element) {
return new ExpectedCondition<Boolean>() {
@Override
public Boolean apply(WebDriver webDriver) {
element.waitUntilVisible();
int heightBefore = element.getSize().getHeight();
sleep(50);
int heightAfter = element.getSize().getHeight();
return (heightBefore == heightAfter && heightAfter > 0);
}
@Override
public String toString() {
return "Dropdown to expand";
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment