elements / inputs
Single UI element
Inputs
Seven input variants — each in its own bench with a fixed id and expected behaviour. Covers text, email, password, number, tel, date, disabled and readonly.
Simple text input
#input-simple- id
- input-simple
- type
- text
- expected
- Accepts any text, no validation.
Code snippets
Python (Selenium)
el = driver.find_element(By.ID, "input-simple")
el.clear()
el.send_keys("Jane Doe")
assert el.get_attribute("value") == "Jane Doe"TypeScript (Playwright)
await page.fill('#input-simple', 'Jane Doe');
expect(await page.inputValue('#input-simple')).toBe('Jane Doe');Email input
#input-email- id
- input-email
- type
- expected
- Browser validates email format on form submit;
@is required.
Code snippets
Python (Selenium)
driver.find_element(By.ID, "input-email").send_keys("qa@test.com")TypeScript (Playwright)
await page.fill('#input-email', 'qa@test.com');Password input
#input-password- id
- input-password
- type
- password
- expected
- Characters masked; value still accessible via
get_attribute("value")in automation.
Code snippets
Python (Selenium)
driver.find_element(By.ID, "input-password").send_keys("Secret123")TypeScript (Playwright)
await page.fill('#input-password', 'Secret123');Number input
#input-number- id
- input-number
- type
- number
- min
- 1
- max
- 120
- expected
- Spinner arrows adjust value; non-numeric input is blocked.
Code snippets
Python (Selenium)
el = driver.find_element(By.ID, "input-number")
el.clear()
el.send_keys("25")TypeScript (Playwright)
await page.fill('#input-number', '25');Tel input
#input-tel- id
- input-tel
- type
- tel
- expected
- No built-in format enforcement; triggers numeric keyboard on mobile.
Code snippets
Python (Selenium)
driver.find_element(By.ID, "input-tel").send_keys("+919876543210")TypeScript (Playwright)
await page.fill('#input-tel', '+919876543210');Disabled input
#input-disabled- id
- input-disabled
- expected
- Value cannot be changed or focused; not part of tab order.
Code snippets
Python (Selenium)
el = driver.find_element(By.ID, "input-disabled")
assert not el.is_enabled()
assert el.get_attribute("value") == "ACC-88213"TypeScript (Playwright)
const el = page.locator('#input-disabled');
await expect(el).toBeDisabled();
expect(await el.inputValue()).toBe('ACC-88213');Readonly input
#input-readonly- id
- input-readonly
- expected
- Focusable and selectable, but value cannot be edited.
Code snippets
Python (Selenium)
el = driver.find_element(By.ID, "input-readonly")
assert el.get_attribute("readonly") is not None
val = el.get_attribute("value") # "REF-2026-004"TypeScript (Playwright)
const el = page.locator('#input-readonly');
expect(await el.getAttribute('readonly')).not.toBeNull();Debounced live search
#input-search- id
- input-search
- results
- #search-results
- expected
- Result list updates ~300 ms after typing stops. Good for practicing explicit waits.
Code snippets
Python (Selenium)
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver.find_element(By.ID, "input-search").send_keys("ap")
# Wait for results to appear
WebDriverWait(driver, 2).until(
EC.presence_of_element_located((By.CSS_SELECTOR, "#search-results li"))
)
items = driver.find_elements(By.CSS_SELECTOR, "#search-results li")
assert any("apple" in i.text for i in items)TypeScript (Playwright)
await page.fill('#input-search', 'ap');
await page.waitForSelector('#search-results li');
const items = await page.locator('#search-results li').allTextContents();
expect(items.some(t => t.includes('apple'))).toBeTruthy();