How to Clear an Input Field in Vibium
Clear an input field in Vibium with el.clear(). Runnable Python examples for emptying text fields, replacing values, and resetting forms.
To clear an input field in Vibium, find it and call clear(), like vibe.find("#email").clear(). Vibium focuses the field, selects all of its contents, and deletes them, leaving the input empty and ready for new text. Because Vibium auto-waits, the field is brought to an actionable state (visible, stable, enabled, editable) before anything is cleared, so you do not need a separate wait or retry. The most common use is replacing an existing value: call clear() to empty the field, then type() to enter the new text — clearing first guarantees your new value is not appended to whatever was already there. This is more reliable than trying to select-and-overwrite manually, since Vibium handles focus and selection internally for any text input or editable field.
How do I empty an input field?
Locate the input with find() and call clear(). Vibium empties the field by selecting its contents and deleting them.
from vibium import browser_sync as browser
vibe = browser.launch()
vibe.go("https://example.com/profile")
# Empty the field
vibe.find("#email").clear()
# Semantic locators work too
vibe.find(label="Full name").clear()
vibe.quit()clear() works on text inputs, textareas, and other editable fields. Because Vibium manages focus and selection for you, you do not need to send keyboard shortcuts like Ctrl+A and Delete yourself.
How do I replace the text in a field?
Clear the field first, then type the new value. Clearing before typing keeps the final value predictable instead of appending to the old contents.
from vibium import browser_sync as browser
vibe = browser.launch()
vibe.go("https://example.com/profile")
email = vibe.find("#email")
email.clear()
email.type("new.address@example.com")
vibe.quit()This clear-then-type pattern is the reliable way to overwrite a pre-filled field. If you skipped the clear(), type() would add your text after the existing value, producing something like the old and new strings joined together.
Does Vibium wait before clearing?
Yes. Clearing begins by focusing the field, and that step runs Vibium's actionability checks: the input must be visible, stable, enabled, and editable. Vibium polls until those conditions hold or the timeout is reached, so you do not clear a field that has not finished loading.
# Vibium waits for the field to be actionable, then clears it
vibe.find("#search").clear()If a field never becomes actionable — for example it stays disabled or read-only — the action times out instead of silently doing nothing. See Waiting and Actionability in Vibium for how the checks work.
Next steps
Frequently asked questions
How do I clear an input field in Vibium?
Find the input with find(), then call clear() on it, like vibe.find('#email').clear(). Vibium focuses the field, selects all of its contents, and deletes them, leaving an empty input. It auto-waits for the field to be actionable first, so no manual wait is needed.
How do I replace text in an input with Vibium?
Call clear() to empty the field, then type() to enter the new value, for example clear the input and then type the replacement string. Clearing first guarantees the new text is not appended to whatever was already there, which keeps the final value predictable.
Does Vibium wait before clearing an input?
Yes. Before clearing, Vibium focuses the element, which runs actionability checks confirming the field is visible, stable, enabled, and editable. It polls until those conditions hold or the timeout is reached, so clearing a not-yet-ready input does not silently fail.
Vibium is created by Jason Huggins. This is an independent tutorial — see the official Vibium site and GitHub repo for canonical docs.
Related guides
How to Check a Checkbox in Vibium
Check a checkbox in Vibium with el.check(). Runnable Python examples for ticking, unticking, verifying state, and handling many checkboxes.
3 min read→Commands & APIHow to Click Elements in Vibium
Click buttons and links in Vibium with el.click(). Runnable Python examples plus how auto-waiting and actionability make clicks reliable.
2 min read→Commands & APIHow to Count Elements in Vibium
Count elements in Vibium with el.count() or len(findAll()). Runnable Python examples for counting rows, links, search results, and assertions.
3 min read→Commands & APIHow to Double-Click in Vibium
Double-click elements in Vibium with el.dblclick(). Runnable Python examples for rows and inline edits, plus how auto-waiting keeps clicks reliable.
3 min read→