Password Input

A password input (type=password).

How to test
driver.findElement(By.id("element_password")).sendKeys("secret");
# Python: driver.find_element(By.ID, "element_password").send_keys('secret')

// Java - Full Test
WebElement password = driver.findElement(By.id("element_password"));
password.clear();
password.sendKeys("secret");
assert password.getAttribute("type").equals("password");
assert password.getAttribute("value").equals("secret");

# Python - Full Test
password = driver.find_element(By.ID, "element_password")
password.clear()
password.send_keys("secret")
assert password.get_attribute("type") == "password"
assert password.get_attribute("value") == "secret"

// Java - Alternative Solution
WebElement el = driver.findElement(By.id("element_password"));
el.clear();
el.sendKeys("secret");
assert el.getAttribute("value").equals("secret");

# Python - Alternative Solution
el = driver.find_element(By.ID, "element_password")
el.clear()
el.send_keys("secret")
assert el.get_attribute("value") == "secret"


Tester Task
  1. Locate the password input using id element_password.
  2. Clear the password field.
  3. Enter secret.
  4. Verify the input type is password.
  5. Verify the field value is secret.