Fix: Flaky Clicks in Vibium
Fix flaky clicks in Vibium — let actionability auto-wait handle timing, target the right element under overlays, and stop adding brittle sleep() calls.
To fix flaky clicks in Vibium, let its built-in actionability checks auto-wait instead of adding sleep() calls, dismiss any overlay covering your target, and select the exact element you mean to click. Vibium is AI-native browser automation on WebDriver BiDi, and before every click it runs four actionability checks: the element must be visible, stable (its position has not moved for 50ms), enabled, and it must receive events — meaning a hit-test at the element's center returns that element, not something on top of it. Vibium polls these checks for up to 30 seconds, so a correctly targeted, reachable button is clicked reliably without any manual waiting. That means a "flaky" click is rarely random: it is usually a cookie banner or modal sitting over the target, an animation that keeps the element moving, a disabled button, or a selector that matches the wrong node. Created by Jason Huggins, co-creator of Selenium and Appium, Vibium implements these checks server-side in its Go binary, so the fix is almost always to remove the blocker — not to retry harder.
Why are my Vibium clicks flaky?
Flaky clicks are usually caused by something Vibium's actionability checks are correctly refusing to click through. Before clicking, Vibium verifies the element is visible, has stopped moving, is enabled, and that a hit-test at its center point lands on the element itself. If a cookie banner, modal, sticky header, or loading overlay covers your target, the receivesEvents check fails — and that is the right behavior, because forcing the click would silently interact with the overlay instead. So the question to ask is not "why is the click random" but "what is in the way, or did I target the wrong node."
How does Vibium's auto-wait already handle timing?
Vibium auto-waits, so the most common "fix" people reach for — adding time.sleep() — usually makes things worse. Before a click, Vibium polls until the element is visible, stable, enabled, and actually clickable, up to a 30-second default. Just call click() and let it wait:
from vibium import browser_sync as browser
vibe = browser.launch()
vibe.go("https://example.com")
# No sleep needed — Vibium waits until the button is actionable, then clicks.
vibe.find('button[data-testid="submit"]').click()
vibe.quit()A fixed sleep() either waits too long (slow) or too short (flaky), while Vibium's actionability wait resolves exactly when the element is ready. Removing manual delays in favor of find().click() is often the single change that makes a script reliable.
How do I click an element hidden behind an overlay?
When a cookie banner, modal, or toast covers your target, Vibium's receivesEvents check fails because the hit-test at the element's center returns the overlay, not your element. The correct fix is to close the overlay first, then click the real element:
from vibium import browser_sync as browser
vibe = browser.launch()
vibe.go("https://example.com")
# Dismiss the blocker first so the real target receives the click.
vibe.find('button[aria-label="Accept cookies"]').click()
# Now the target is on top and the click lands correctly.
vibe.find('a[data-testid="get-started"]').click()
vibe.quit()This is more reliable than trying to force a click through the overlay, which would interact with the wrong element. If a blocker appears unpredictably, dismiss it as the first step of your flow so later clicks are never obstructed.
How do I target the exact element I mean to click?
A click that lands on the wrong node is often a selector that matches more than one element. Vibium supports precise semantic selectors — by role, text, label, placeholder, or testid — that target elements the way a user perceives them, which avoids matching a stray container:
from vibium import browser_sync as browser
vibe = browser.launch()
vibe.go("https://example.com")
# Match the actual button by role + text, not a div that merely contains "Submit".
vibe.find(role="button", text="Submit").click()
# Or pin to a stable test id.
vibe.find(testid="checkout").click()
vibe.quit()When you pass text, Vibium prefers the element with the shortest matching text, so a real <button>Submit</button> wins over a paragraph that happens to contain the word. Prefer testid, role, or a stable id over brittle deep CSS paths, which break when the layout shifts.
What if the element keeps moving?
If a click intermittently fails on an animated element, the stable check is doing its job — it refuses to click a target whose bounding box is still changing. Vibium waits for the element to settle, so usually you just let it. If an animation runs effectively forever (a spinner, an infinite carousel), wait for the post-animation state instead by targeting the element that appears once motion stops, letting find() auto-wait for it.
Tips for reliable clicks
- Remove
sleep()calls — Vibium's actionability wait is smarter and faster. - Dismiss overlays first so the real target receives the click.
- Use semantic selectors (
role,text,testid) to target the exact element. - Trust the
stablecheck on animated elements instead of forcing a click. - Lower the timeout on optional elements so a missing target fails fast.
For the full actionability behavior and any options you are unsure about, see how actionability works and the official docs at vibium.com.
Next steps
Frequently asked questions
Why are my Vibium clicks flaky?
Most flaky clicks are not a Vibium problem but a covered or moving target. Vibium runs actionability checks before every click, so if a cookie banner, modal, or loading spinner sits over your element, the click correctly fails or hits the overlay. Dismiss the blocker first, then click the real element.
Does Vibium wait before clicking?
Yes. Before every click Vibium checks that the element is visible, stable, enabled, and actually receives the click at its center point, polling up to a 30-second default. This auto-wait removes the need for manual sleep() calls and is why explicit delays usually make clicks less reliable, not more.
How do I click an element hidden behind an overlay?
Vibium's receivesEvents check fails when something covers your target, which is the correct, safe behavior. The fix is to close the overlay first — dismiss the cookie banner, modal, or toast — then click the real element. Forcing a click through an overlay would silently interact with the wrong thing.
Vibium is created by Jason Huggins. This is an independent tutorial — see the official Vibium site and GitHub repo for canonical docs.
Related guides
Fix: Vibium Screenshot Comes Out Blank
Why your Vibium screenshot comes out blank or white, and how to fix it — wait for content, full_page=True, set a viewport, and verify the PNG bytes.
4 min read→TroubleshootingFix: Vibium Chrome Download Fails
Vibium Chrome download fails on first launch? Fix it with vibium install, by clearing network/proxy and disk-space blocks, plus Linux deps.
4 min read→TroubleshootingFix: Vibium 'Element Not Found' Errors
Fix Vibium 'element not found' errors — correct the selector, switch to semantic find, handle iframes and timing, and target elements the way a user sees them.
4 min read→TroubleshootingFix: Vibium Headless Crashes on Linux
Fix Vibium headless crashes on Linux — install Chrome's missing shared libraries, add --no-sandbox in containers, and give /dev/shm enough space.
4 min read→