How to Automate a Login Flow with Vibium
Step-by-step guide to automating a website login with Vibium in Python — find the fields, type credentials, submit, and verify the result.
To automate a login with Vibium: open the login page, find() the username and password inputs, type() the credentials, click() submit, then verify the result. Vibium auto-waits for each element, so you don't need manual sleeps.
The full login script
from vibium import browser_sync as browser
vibe = browser.launch()
vibe.go("https://app.example.com/login")
email = vibe.find('input[id="login-username"]')
email.type("user@example.com")
password = vibe.find('input[id="login-password"]')
password.type("secure-password")
submit = vibe.find('button[id="login-btn"]')
submit.click()
vibe.quit()Step by step
- Open the page —
vibe.go(url)navigates and waits for load. - Find the fields —
vibe.find(css)returns an element. Vibium waits until it's actionable (visible, enabled) before you interact. - Type credentials —
element.type("...")enters text like a real user. - Submit —
element.click()on the login button.
Verify the login worked
After submitting, read an element that only appears when logged in (or an error message on failure):
error = vibe.find('div[id="login-error"]')
print(error.text())Tip: keep credentials out of your code — read them from environment variables (
os.environ["APP_PASSWORD"]) so you never commit secrets.
Next steps
- Take a screenshot to debug failed logins
- What is Vibium?
Frequently asked questions
How do I automate login with Vibium?
Navigate to the login page, find the username and password inputs with find(), type() the credentials, click the submit button, then read the page to verify success.
How does Vibium find form fields?
Use vibe.find() with a CSS selector (for example an input id or name). Vibium auto-waits for the element to be actionable before interacting with it.
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 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.
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→