Created
December 19, 2020 17:10
-
-
Save eliasnogueira/770dfa403b816cbd3a32f1fbd7422bd9 to your computer and use it in GitHub Desktop.
Clean input fields using Selenium WebDriver + Java
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
// pre and post conditions ignored | |
@Test | |
void cleanUsingSelenium() { | |
WebElement email = driver.findElement(By.id("email")); | |
email.clear(); | |
email.sendKeys("new@email.com"); | |
WebElement password = driver.findElement(By.id("password")); | |
password.clear(); | |
password.sendKeys("987654321"); | |
WebElement address = driver.findElement(By.id("address")); | |
address.clear(); | |
address.sendKeys("Viebrug"); | |
WebElement address2 = driver.findElement(By.id("address2")); | |
address2.clear(); | |
address2.sendKeys("1"); | |
WebElement city = driver.findElement(By.id("city")); | |
city.clear(); | |
city.sendKeys("Utrecht"); | |
WebElement zipCode = driver.findElement(By.id("zipcode")); | |
zipCode.clear(); | |
zipCode.sendKeys("3511 AJ"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment