Skip to content

Commit

Permalink
optimize clearField step for all cases and platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
JasperJhons committed Sep 4, 2017
1 parent e351666 commit cbe4da9
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public void sendText(@Named("$textOrKeyword") String textOrKeyword) {
@When("очистить \"$fieldName\"")
public void clearField(@Named("$fieldName") String fieldName) {
WebElement webElement = getWebElementByName(fieldName);
webElement.clear();
Keyboard keyboard = driver.getKeyboard();
for (int i = webElement.getText().length(); i > 0; i--) {
keyboard.sendKeys(Keys.BACK_SPACE);
Expand Down

0 comments on commit cbe4da9

Please sign in to comment.