Overview
Inspect the Chrome accessibility tree to find elements by semantic properties (role, name, description). Provides three core commands:- tree: Display full accessibility tree
- query: Search by role/name/description patterns
- describe: Get accessibility properties for CSS selector
Commands
bdg dom a11y tree
Display the full accessibility tree for the current page.Options
Output full tree as JSON (for jq filtering)
Examples
Output format
bdg dom a11y query
Query elements by accessibility properties using pattern matching.Arguments
Query pattern with field prefix:
role:button, name:Submit, description:textSupports wildcards: name:*search*Options
Output results as JSON
Pattern syntax
| Pattern | Description | Example |
|---|---|---|
role:<value> | Filter by ARIA role | role:button |
name:<value> | Filter by accessible name | name:Submit |
description:<value> | Filter by description | description:Click to submit |
| Wildcards | Match partial strings | name:*search* |
| Combine | AND logic with comma | role:button,name:Submit |
Examples
Output
bdg dom a11y describe
Get detailed accessibility properties for a specific element.Arguments
CSS selector or numeric index from query results (0-based)
Options
Output as JSON with full accessibility node structure
Examples
Output
Quick search shorthand
The basebdg dom a11y command supports quick search patterns:
Common workflows
Find and interact with button
Verify form accessibility
Navigate by headings
JSON output for automation
Tree structure
Query result structure
Exit codes
Success - tree retrieved or nodes found
INVALID_ARGUMENTS - invalid query pattern syntax
RESOURCE_NOT_FOUND - no elements match query
STALE_CACHE - cached index invalid
CDP_TIMEOUT - CDP operation timed out
Accessibility tree vs DOM
The accessibility tree is a semantic representation of the page:| Aspect | Accessibility Tree | DOM Tree |
|---|---|---|
| Purpose | Assistive technology | Browser rendering |
| Nodes | Semantic roles only | All HTML elements |
| Filtering | Ignores decorative elements | Includes everything |
| Names | Computed accessible names | Raw text content |
| Properties | Focusable, disabled, required | All HTML attributes |
When to use each
Use accessibility tree for:- Finding interactive elements (buttons, inputs)
- Testing screen reader experience
- Semantic element discovery
- Role-based automation
- Styling and layout debugging
- Finding elements by class/ID
- Inspecting raw HTML attributes
- Custom data attributes
Common roles
| Role | Element examples |
|---|---|
button | <button>, <input type="button"> |
link | <a href="..."> |
textbox | <input type="text">, <textarea> |
checkbox | <input type="checkbox"> |
heading | <h1> - <h6> |
navigation | <nav> |
main | <main> |
form | <form> |
list | <ul>, <ol> |
listitem | <li> |
Related commands
bdg dom query- Find elements by CSS selectorbdg dom get- Get semantic or raw element infobdg dom form- Discover form structure

