VLearnVibium

How to Hover Over an Element in Vibium

Hover over elements in Vibium with el.hover(). Runnable Python examples for menus and tooltips, plus how auto-waiting keeps hovers reliable.

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

To hover over an element in Vibium, find it and call hover(), like vibe.find(".menu").hover(). Vibium scrolls the element into view, waits for it to become actionable, and moves the pointer to its center so any hover-driven UI — dropdown menus, tooltips, image overlays — reacts exactly as it would for a real user. The hover is performed through WebDriver BiDi's input.performActions pointer-move, the same low-level path a genuine mouse uses, which means CSS :hover rules and mouseenter/mouseover JavaScript listeners both fire. Because Vibium auto-waits before every interaction, you do not need sleep() calls or manual retry loops to let an element finish loading first. This makes hover() ideal for navigating nested menus, surfacing tooltips before reading their text, or revealing action buttons that only appear when the pointer is over a row.

How do I hover over an element?

Locate the element with find() and chain hover() onto it. Vibium moves the pointer over the element's center point.

from vibium import browser_sync as browser
 
vibe = browser.launch()
vibe.go("https://example.com")
 
# Hover by CSS selector
vibe.find(".nav-item").hover()
 
# Or find first, then hover
menu = vibe.find("#account-menu")
menu.hover()
 
vibe.quit()

You can also target the element semantically, which is useful when class names are unstable:

vibe.find(role="button", text="Settings").hover()

Targeting by role and text in one call keeps your hover locators resilient when the markup changes. See how to find elements in Vibium for every selector strategy.

Does Vibium wait before hovering?

Yes. Before the pointer moves, Vibium runs its actionability checks: the element must be visible, stable (its position has settled), and able to receive events. Vibium polls until those conditions hold or the timeout is reached, so you never hover over an element that has not finished rendering.

# Vibium waits for the element to be actionable, then hovers
vibe.find(".tooltip-trigger").hover()
print(vibe.find(".tooltip-text").text())

This auto-waiting is why hover-then-read patterns stay reliable: the trigger is actionable before the pointer moves, and the tooltip has time to appear before you read it. See waiting and actionability in Vibium for the full picture.

How do I open a hover menu and click a submenu item?

Hover the trigger to reveal the menu, then find and click the nested item. Vibium auto-waits on each step, so the dropdown has time to render before you click into it.

from vibium import browser_sync as browser
 
vibe = browser.launch()
vibe.go("https://example.com")
 
# Reveal the dropdown by hovering its trigger
vibe.find("#products-menu").hover()
 
# Then click the submenu item that just appeared
vibe.find(role="link", text="Pricing").click()
 
print(vibe.find("h1").text())
 
vibe.quit()

For multi-level menus, chain the hovers: hover the top-level item, hover the submenu item, then click the final link. Each hover() waits for its target to be actionable, which keeps deep navigation stable even on animated menus.

Next steps

Frequently asked questions

How do I hover over an element in Vibium?

Find the element with find(), then call hover() on it, like vibe.find('.menu').hover(). Vibium scrolls the element into view, waits for it to be actionable, and moves the pointer over its center so hover-triggered menus and tooltips appear without any manual wait code.

Does Vibium wait before hovering?

Yes. Before moving the pointer, Vibium runs actionability checks confirming the element is visible, stable, and receiving events. It polls until those pass or the timeout is reached, so hovering an element that has not finished rendering does not silently miss the target.

How do I open a hover menu in Vibium?

Call hover() on the trigger element to reveal the menu, then find() and click() the submenu item. Vibium auto-waits on each step, so the dropdown has time to appear before you interact with it, keeping nested hover navigation reliable.

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

Related guides