Skip to content

Instantly share code, notes, and snippets.

@seleniumgists
Created October 17, 2018 11:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seleniumgists/e0424dfb01d5a8d9cd16f0ca6c0d144a to your computer and use it in GitHub Desktop.
Save seleniumgists/e0424dfb01d5a8d9cd16f0ca6c0d144a to your computer and use it in GitHub Desktop.
generated automatically from #selenium on seleniumhq slack
default void setInputText(Supplier<By> by, Object value) {
if (value == null) return;
Element element = await(by);
await((Predicate<SearchScope>) searchScope -> {
element.clear();
return element.getValue().isEmpty();
});
String stringValue = value.toString();
element.sendKeys(stringValue);
assert stringValue.equals(element.getValue());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment