Skip to content

Python client missing element.highlight() despite API docs and backend support #208

Description

@Jhoan0714

Summary

The Python client does not implement element.highlight(), even though the official API reference documents it, the Go backend exposes vibium:element.highlight, and the Java client already implements it. Users following the docs get AttributeError at runtime.

Impacted operations

  • element.highlight() (sync API)
  • await element.highlight() (async API)

Expected behavior

After finding an element, calling highlight() should send vibium:element.highlight to the backend and briefly outline the element in the browser (same as Java and CLI).

Actual behavior

Element has no highlight method:

AttributeError: 'Element' object has no attribute 'highlight'

Root cause

The full stack already supports highlighting except the Python client:

  • docs/reference/api.md (row 79) documents el.highlight() for Python
  • Go handler handleVibiumElHighlight implements vibium:element.highlight in clicker/internal/api/handlers_state.go
  • Java implements it as a one-line sendAction("vibium:element.highlight") in clients/java/src/main/java/com/vibium/Element.java
    But Python never added the equivalent thin BiDi wrapper in:
  • clients/python/src/vibium/async_api/element.py
  • clients/python/src/vibium/sync_api/element.py

Reproduction (Python)

Environment

  • OS: macOS (darwin arm64)
  • vibium (PyPI): 26.5.31
  • Python: 3.9.x

Minimal repro

from vibium import browser
b = browser.start(headless=True)
p = b.new_page()
p.go("https://example.com")
el = p.find("h1")
el.highlight()
b.stop()

Output

AttributeError: 'Element' object has no attribute 'highlight'

Proposed fix

Add highlight() to both Python Element wrappers, mirroring Java's sendAction("vibium:element.highlight") pattern used by other interaction methods (focus, hover, etc.):

  • Async (async_api/element.py): await self._client.send("vibium:element.highlight", self._command_params())
  • Sync (sync_api/element.py): delegate to async via self._loop.run(self._async.highlight())
    And add tests (async + sync) asserting the call completes without AttributeError or unknown-command BiDiError, similar to JavaClusterFixTest.highlightIsImplemented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions