fix: preserve empty accessibility names by vicksiyi · Pull Request #5081 · browser-use/browser-use · GitHub
Skip to content

fix: preserve empty accessibility names#5081

Open
vicksiyi wants to merge 2 commits into
browser-use:mainfrom
vicksiyi:codex/preserve-empty-ax-name
Open

fix: preserve empty accessibility names#5081
vicksiyi wants to merge 2 commits into
browser-use:mainfrom
vicksiyi:codex/preserve-empty-ax-name

Conversation

@vicksiyi

@vicksiyi vicksiyi commented Jun 24, 2026

Copy link
Copy Markdown

Summary

  • Preserved ax_node.name whenever it is not None and added regression coverage for empty string vs missing accessibility names.

Tests

  • uv run ruff check browser_use/dom/views.py tests/ci/test_dom_interacted_element.py passed
  • uv run ruff format --check browser_use/dom/views.py tests/ci/test_dom_interacted_element.py passed
  • git diff --check passed
  • python3 -m py_compile browser_use/dom/views.py tests/ci/test_dom_interacted_element.py passed
  • uv run pytest tests/ci/test_dom_interacted_element.py blocked by local pytest startup segfault

Notes


Summary by cubic

Fixes DOM element mapping and hashing to preserve empty accessibility names. We keep an empty ax_node.name, include it in hashes, and only use None when the name is missing.

  • Bug Fixes
    • Preserve empty ax_node.name in DOMInteractedElement.load_from_enhanced_dom_tree.
    • Include empty names in compute_stable_hash and __hash__ to distinguish empty vs missing.

Written for commit 2b656ee. Summary will update on new commits.

Review in cubic

@CLAassistant

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread browser_use/dom/views.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants