Created
October 17, 2018 11:49
-
-
Save seleniumgists/0736b9e77b7b0696f7056b982f991106 to your computer and use it in GitHub Desktop.
generated automatically from #selenium on seleniumhq slack
This file contains 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
default void setInputTextWithAction(Supplier<By> by, Object value) { | |
if (value == null) return; | |
String stringValue = value.toString(); | |
Element element = await(by); | |
element.click(); | |
element.sendKeys(END); | |
while (!element.getValue().isEmpty()) { | |
element.sendKeys(BACK_SPACE); | |
} | |
element.sendKeys(stringValue); | |
element.sendKeys(TAB); | |
element.click(); | |
assert stringValue.equals(element.getValue()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment