VLearnVibium

How to Find Elements in Vibium

Find elements in Vibium with find() using CSS or semantic selectors. Runnable Python examples, findAll, and how auto-waiting works.

By Pramod Dutta··3 min read·Verified with Vibium 26.2
▶ Animated overview · made with Remotion

To find an element in Vibium, call find() on your page object with a CSS selector, like el = vibe.find("#email"). Vibium returns an Element and automatically waits for it to exist and become actionable before you interact with it, so there's no separate "wait then find" step and no manual retry loop. Beyond CSS strings, find() also accepts semantic options — role, text, label, placeholder, and testid — which you pass as keyword arguments, for example vibe.find(role="button", text="Submit"), and you can combine several at once for more resilient locators. When you need every match instead of the first, use findAll(), which returns a list immediately (an empty list if nothing matches) without waiting. This auto-waiting, multi-strategy locator model is what makes Vibium finds far less flaky than classic WebDriver lookups.

How do I find an element by CSS selector?

Pass a CSS selector string to find() and Vibium returns the first matching element. This is the common case and covers roughly 80% of real-world selectors.

from vibium import browser_sync as browser
 
vibe = browser.launch()
vibe.go("https://example.com")
 
# CSS selectors — just a string
heading = vibe.find("h1")
email = vibe.find("#email")
search = vibe.find('input[name="q"]')
 
print(heading.text())
 
vibe.quit()

A single find() call works like document.querySelector() under the hood, returning the first match. Because finding and auto-waiting happen inside Vibium's Go engine, the same timing behavior applies no matter which selector you use.

How do I find an element by role, text, or label?

Use the semantic form of find() by passing keyword arguments instead of a CSS string. This matches elements by their accessible role, visible text, label, placeholder, and more.

from vibium import browser_sync as browser
 
vibe = browser.launch()
vibe.go("https://example.com")
 
# Semantic selectors — keyword arguments
vibe.find(role="button")
vibe.find(text="Sign In")
vibe.find(label="Email")
vibe.find(placeholder="Search...")
 
# Combine strategies in one call
submit = vibe.find(role="button", text="Submit")
submit.click()
 
vibe.quit()

Combining strategies is the standout feature here: find(role="button", text="Submit") targets a button whose text is "Submit" in a single call. When several elements match a text query, Vibium prefers the element with the shortest text content, so a real <button>Submit</button> wins over a paragraph that merely mentions the word.

How do I find multiple elements?

Call findAll() to get every matching element as a list. Unlike find(), it returns immediately and gives an empty list when nothing matches rather than waiting.

from vibium import browser_sync as browser
 
vibe = browser.launch()
vibe.go("https://example.com")
 
links = vibe.findAll("a")
print(f"Found {len(links)} links")
 
for link in links:
    print(link.text())
 
vibe.quit()

Reach for findAll() when you want to count results or iterate over a list, and use find() when you need one element that you are about to click, type into, or read.

Why you do not need manual waits

Before any interaction, Vibium runs actionability checks (visible, stable, receives events, enabled) and polls until they pass or a timeout is reached. That means a plain vibe.find("#submit").click() already waits up to the default timeout for the element to be ready. See Waiting and Actionability in Vibium for the full picture.

Next steps

Frequently asked questions

How do I find an element in Vibium?

Call find() on the page object with a CSS selector, like el = vibe.find('#email'). Vibium returns an Element and auto-waits for it to become actionable, so you do not need to write your own retry or wait-for loops before interacting.

Does Vibium support semantic selectors?

Yes. Besides CSS strings, find() accepts semantic options such as role, text, label, placeholder, and testid. In Python you pass them as keyword arguments, for example vibe.find(role='button', text='Submit'), and you can combine several at once.

How do I find multiple elements in Vibium?

Use findAll() instead of find(). It returns a list of matching Elements immediately and gives an empty list when nothing matches, so it does not wait. Use find() with auto-waiting when you need a single element that may still be loading.

Vibium is created by Jason Huggins. This is an independent tutorial — see the official Vibium site and GitHub repo for canonical docs.

Related guides