elements / textarea
Single UI element
Text area
Free-form multi-line text boxes: one with live character counting / length limiting, and another non-resizable fixed block.
Text area with counter
#textarea-counter- id
- textarea-counter
- counter
- #textarea-counter-out
- expected
- Counter updates on every keystroke; input is blocked past 200 chars.
Code snippets
Python (Selenium)
ta = driver.find_element(By.ID, "textarea-counter")
ta.send_keys("Found a critical bug during checkout.")
cnt = driver.find_element(By.ID, "textarea-counter-out")
assert cnt.text.startswith("37 / 200")TypeScript (Playwright)
await page.fill('#textarea-counter', 'Found a critical bug during checkout.');
expect(await page.textContent('#textarea-counter-out')).toContain('37 / 200');Fixed, non-resizable text area
#textarea-fixed- id
- textarea-fixed
- expected
- Drag-to-resize handle is disabled via CSS; box remains a fixed 3 rows tall.
Code snippets
Python (Selenium)
ta = driver.find_element(By.ID, "textarea-fixed")
resize_prop = ta.value_of_css_property("resize")
assert resize_prop == "none"TypeScript (Playwright)
const resize = await page.evalOnSelector(
'#textarea-fixed',
(el: HTMLElement) => getComputedStyle(el).resize
);
expect(resize).toBe('none');