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.
To check a checkbox in Vibium, find it and call check(), like vibe.find("#terms").check(). Vibium ticks the box only when it is not already selected, so check() is idempotent — running it on an already-checked box leaves it checked instead of toggling it off. The matching uncheck() does the reverse, clicking only when the box is currently ticked. Both methods run Vibium's actionability checks first (visible, stable, enabled, receiving events) and auto-wait until the control is ready, so you never tick a checkbox that has not finished rendering. To confirm the result, read isChecked(), which returns a plain Python boolean you can assert on directly. This state-aware design is what makes checkbox handling in Vibium far less flaky than a raw click(), which would blindly flip whatever state the box happens to be in.
How do I check a checkbox?
Locate the checkbox with find() and call check(). Vibium ticks it only if it is not already selected, so the box reliably ends up checked.
from vibium import browser_sync as browser
vibe = browser.launch()
vibe.go("https://example.com/signup")
# Tick the box (no-op if already checked)
vibe.find("#terms").check()
# Semantic locators work too
vibe.find(label="Subscribe to newsletter").check()
vibe.quit()Using check() instead of click() matters: a plain click toggles the checkbox to the opposite state, so re-running your script could leave the box unchecked. check() always lands on the checked state no matter where it started.
How do I uncheck a checkbox?
Call uncheck() to clear a checkbox. Vibium clicks it only when it is currently ticked, leaving an already-empty box alone.
from vibium import browser_sync as browser
vibe = browser.launch()
vibe.go("https://example.com/preferences")
# Clear the box (no-op if already unchecked)
vibe.find("#newsletter").uncheck()
vibe.quit()Like check(), this is idempotent: you always reach the unchecked state regardless of the starting point, which keeps tests deterministic across repeated runs.
How do I verify a checkbox is checked?
Read the control's state with isChecked(), which returns a boolean. Use it in a plain Python assertion or condition.
from vibium import browser_sync as browser
vibe = browser.launch()
vibe.go("https://example.com/signup")
terms = vibe.find("#terms")
terms.check()
assert terms.isChecked(), "Terms checkbox should be selected"
vibe.quit()Because isChecked() returns a normal bool, it drops straight into pytest, unittest, or any assertion library you already use — no special matcher to learn.
How do I handle many checkboxes at once?
Use findAll() to collect every checkbox as a list, then loop and check() each one. findAll() returns its matches immediately rather than auto-waiting.
from vibium import browser_sync as browser
vibe = browser.launch()
vibe.go("https://example.com/options")
for box in vibe.findAll('input[type="checkbox"]'):
box.check()
vibe.quit()This is the standard pattern for "select all" behavior or for ticking every row in a settings list. Pair it with isChecked() in a second loop if you want to assert that every box ended up selected.
Next steps
Frequently asked questions
How do I check a checkbox in Vibium?
Find the checkbox with find(), then call check() on it, like vibe.find('#terms').check(). Vibium ticks the box only if it is not already checked, so calling check() repeatedly is safe and the box ends up selected without toggling it back off.
How do I uncheck a checkbox in Vibium?
Call uncheck() instead of check(), for example vibe.find('#newsletter').uncheck(). Vibium clicks the box only when it is currently checked, leaving an already-unchecked box untouched. This idempotent behavior means you always reach the unchecked state regardless of the starting point.
How do I verify a checkbox is checked in Vibium?
Read its state with isChecked(), which returns a boolean, for example assert vibe.find('#terms').isChecked(). Because it returns a plain Python bool, you can use it directly in an assertion or an if statement without any Vibium-specific matcher.
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 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→Commands & APIHow to Double-Click in Vibium
Double-click elements in Vibium with el.dblclick(). Runnable Python examples for rows and inline edits, plus how auto-waiting keeps clicks reliable.
3 min read→