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
Accessibility Testing with Vibium
Accessibility testing with Vibium — read the a11y tree, assert on roles, names, and states, and catch WCAG issues in CI with no driver setup.
14 min read→How-To RecipesMixing API + Web Testing with Vibium
Mix API and web testing with Vibium — assert on backend JSON with waitForResponse and route while driving the real UI, in one script.
14 min read→How-To RecipesBulk Data Extraction with Vibium
Bulk data extraction with Vibium: build a repeatable scrape pipeline over a URL list, extract with findAll(), and write clean JSON, CSV, or a database.
13 min read→How-To RecipesE-commerce Test Automation with Vibium
E-commerce test automation with Vibium: script cart, checkout, and payment flows in JS or Python with auto-waiting, AI checks, and CI-ready smoke tests.
15 min read→