How to Right-Click (Context Menu) in Vibium
Right-click to open context menus in Vibium using el.bounds() with page.mouse, or the AI-native do() method. Runnable Python examples included.
To right-click in Vibium, get the element's position with el.bounds() and click that point with the secondary mouse button via page.mouse.click(). Vibium sends a real secondary-button pointer action through WebDriver BiDi's input.performActions, so the browser raises its native contextmenu event and any custom right-click menu opens just as it would for a human user. There is no separate rightClick() shortcut — right-click is composed from the documented mouse primitives, which keeps the behavior explicit and predictable. For cases where you would rather describe intent than wire up coordinates, Vibium's AI-native do() method accepts plain English like vibe.do("right-click the row and choose Delete") and plans the same low-level steps under the hood. Either approach fires the context menu reliably, after which you find and click the menu item with Vibium's normal, auto-waiting find() and click() calls.
How do I right-click an element?
Read the element's bounding box with el.bounds() to compute its center, then click that coordinate with the right button using page.mouse. The secondary-button click dispatches the contextmenu event.
from vibium import browser_sync as browser
vibe = browser.launch()
vibe.go("https://example.com")
# Locate the target and read its position
target = vibe.find(".file-row")
box = target.bounds() # {x, y, width, height}
# Click its center with the secondary (right) mouse button
center_x = box["x"] + box["width"] / 2
center_y = box["y"] + box["height"] / 2
vibe.mouse.click(center_x, center_y, button="right")
vibe.quit()The page.mouse API maps directly to BiDi pointer actions, so the right button produces a genuine secondary-button event rather than a simulated one. If you are unsure of the exact mouse signature for your Vibium version, check the official Vibium reference — but the pattern above (read bounds, click the center with the right button) is the documented approach.
How do I open a custom context menu and pick an item?
Right-click the target to surface the menu, then find and click the option you want. Vibium auto-waits on the follow-up click, so the menu has time to render before you interact with it.
from vibium import browser_sync as browser
vibe = browser.launch()
vibe.go("https://example.com")
row = vibe.find("#row-42")
box = row.bounds()
vibe.mouse.click(box["x"] + box["width"] / 2,
box["y"] + box["height"] / 2,
button="right")
# The context menu listens for the contextmenu event and appears
vibe.find(role="menuitem", text="Delete").click()
vibe.quit()Because the secondary-button click fires the page's contextmenu event, custom menus built in JavaScript open the same way the browser's native menu would. The subsequent click() runs Vibium's actionability checks, so a freshly rendered menu item is waited for automatically. See waiting and actionability in Vibium for the details.
Can I right-click with plain English?
Yes. Vibium is AI-native, so the do() method takes a natural-language instruction and plans the steps for you, executing them through Vibium's own deterministic mouse and find commands.
# Describe the action; Vibium plans and runs the steps
vibe.do("right-click the first file row and choose Rename")This is handy when you do not want to compute coordinates by hand, or when the exact selector is awkward. Under the hood it is the same right-click-then-click pattern shown above — AI planning, not AI puppeteering. To learn more about Vibium's AI methods, see what is Vibium.
Next steps
Frequently asked questions
How do I right-click in Vibium?
Read the element's position with el.bounds() to get its center, then call page.mouse.click() at that point with the right button. Vibium dispatches a real secondary-button pointer event through WebDriver BiDi, so the browser's contextmenu event and any custom right-click menu open as expected.
Can Vibium open a custom context menu?
Yes. Right-clicking fires the page's contextmenu event, which is what custom menus listen for. After the secondary-button click, find() and click() the menu item that appears. Vibium auto-waits on the follow-up click, so the menu has time to render before you select an option.
Can I right-click with plain English in Vibium?
Yes. The AI-native do() method accepts natural language, so you can describe the action like vibe.do('right-click the first row and choose Delete'). Vibium plans the steps and runs them through its own deterministic mouse and find commands under the hood.
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 Check a Checkbox in Vibium
Check a checkbox in Vibium with el.check(). Runnable Python examples for ticking, unticking, verifying state, and handling many checkboxes.
3 min read→Commands & APIHow to Clear an Input Field in Vibium
Clear an input field in Vibium with el.clear(). Runnable Python examples for emptying text fields, replacing values, and resetting forms.
2 min read→Commands & APIHow to Click Elements in Vibium
Click buttons and links in Vibium with el.click(). Runnable Python examples plus how auto-waiting and actionability make clicks reliable.
2 min read→Commands & APIHow to Count Elements in Vibium
Count elements in Vibium with el.count() or len(findAll()). Runnable Python examples for counting rows, links, search results, and assertions.
3 min read→