How to Fill and Submit a Form with Vibium
Automate an HTML form with Vibium in Python — type into text fields, check boxes, pick dropdown options, submit, and verify the result with auto-waiting.
To fill and submit a form with Vibium, find() each field, type() text, check() boxes, select_option() dropdowns, then click() submit and verify the result. Vibium auto-waits for every element to be actionable, so there are no brittle sleeps between steps.
What is the full form script?
from vibium import browser_sync as browser
vibe = browser.launch()
vibe.go("https://example.com/signup")
vibe.find("#name").type("Jane Doe")
vibe.find("#email").type("jane@example.com")
vibe.find("#country").select_option("India")
vibe.find("#terms").check()
vibe.find('button[type="submit"]').click()
confirmation = vibe.find(".signup-success")
print(confirmation.text())
vibe.quit()This enters a name and email, picks a dropdown value, ticks the terms checkbox, submits, and prints the success message.
How does each step work?
vibe.go(url)— open the page that holds the form.find("#name").type("...")— enter text like a real user, keystroke by keystroke.find("#country").select_option("India")— choose a value in a<select>dropdown.find("#terms").check()— tick a checkbox (it only clicks if not already checked).find('button[type="submit"]').click()— submit the form.confirmation.text()— read the success element to confirm it worked.
Because Vibium waits for each element to be visible and enabled before acting, you do not sprinkle sleep() calls between fields.
Should I use type() or fill()?
Both put text in a field, but they behave differently:
# type(): character by character, keeps existing text. Good when the
# page reacts to each keystroke (autocomplete, live validation).
vibe.find("#search").type("vibium")
# fill(): clears the field, then sets the value in one shot. Faster,
# cleaner for plain data entry.
vibe.find("#email").fill("jane@example.com")Reach for type() when the UI responds to keystrokes, and fill() when you just want the value in place quickly.
How do I verify validation errors?
When a submission fails, read the error element instead of the success one. Keep credentials and personal data out of source by pulling them from environment variables:
import os
vibe.find("#email").fill(os.environ["TEST_EMAIL"])
vibe.find('button[type="submit"]').click()
error = vibe.find(".field-error")
print(error.text()) # "Email is already registered"Tips for solid form automation
- Target stable selectors — an
idordata-testidsurvives redesigns better than deep CSS paths. - Read the value back with
el.value()to confirm what actually landed in a field. - Check before you assume success — always read a success or error element after submit.
Next steps
Frequently asked questions
How do I fill and submit a form with Vibium?
Find each field with find(), type() text into inputs, check() boxes, and select_option() for dropdowns, then click() the submit button. Vibium auto-waits for every field to be actionable, so you do not need manual sleeps between steps.
What is the difference between type() and fill() in Vibium?
type() enters text character by character like a real user and leaves existing text in place. fill() clears the field first and sets the value in one step. Use type() when the page reacts to each keystroke; use fill() for fast, clean data entry.
How do I verify a form submitted successfully with Vibium?
After clicking submit, read an element that only appears on success, such as a confirmation message, with find() and text(). On failure, read the validation or error element instead. Vibium waits for the element, so timing is handled for you.
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 Download a File with Vibium
Trigger and save a browser download with Vibium in Python — use capture.download() to grab the file, read its name, and save it with save_as().
2 min read→How-To RecipesHow to Scrape a Table with Vibium
Extract rows and cells from an HTML table with Vibium in Python — find the rows with findAll(), read each cell's text with a scoped find, and build clean structured data.
3 min read→How-To RecipesHow to Take a Full-Page Screenshot with Vibium
Capture an entire scrolling web page as a single PNG with Vibium in Python — the full-page screenshot pattern, runnable code, and a step-by-step breakdown.
3 min read→How-To RecipesHow to Test a Single-Page App (SPA) with Vibium
Test a React, Vue, or Angular SPA with Vibium in Python — handle client-side routing, wait for async content, and assert on dynamically rendered elements.
3 min read→