Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Teamcapybara Capybara Selection Controls

From Leeroopedia
Revision as of 18:05, 16 February 2026 by Admin (talk | contribs) (Auto-imported from principles/Teamcapybara_Capybara_Selection_Controls.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains Testing, Form_Interaction
Last Updated 2026-02-12 00:00 GMT

Overview

A form interaction pattern for manipulating selection-based form controls including dropdowns, checkboxes, and radio buttons.

Description

Selection Controls covers three types of form elements that represent choices:

  • Select boxes — Dropdowns where the user picks an option by its visible text. select finds the select box by label/name/id and then finds and selects the option.
  • Checkboxes — Toggle elements for boolean or multi-select choices. check and uncheck find the checkbox by label/name/id and toggle its state. When the element is not visible, it attempts to click the associated label instead (automatic_label_click).
  • Radio buttons — Mutually exclusive choices. choose finds the radio button and selects it, also supporting label clicking for hidden inputs.

Usage

Use select for dropdown menus, check/uncheck for checkboxes, and choose for radio buttons. All use semantic locators (label text, name, id) rather than CSS selectors.

Theoretical Basis

# Abstract selection flow (not actual code)
select(value, from: locator):
  box = find(:select, locator) or find(:datalist_input, locator)
  box.find(:option, value).select_option

check(locator):
  _check_with_label(:checkbox, true, locator)
  # attempts element.set(true), falls back to clicking label

choose(locator):
  _check_with_label(:radio_button, true, locator)

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment