Skip to content

click_element fails with -32000 for text() XPath that query_elements accepts #15

Description

@AminDhouib

Summary

click_element fails with JSON-RPC -32000 "DOM Error while querying" for a text()-based XPath that query_elements accepts and resolves correctly.

Repro

On a page containing an element whose text is "University of Ottawa":

  1. query_elements with //*[contains(text(),'University of Ottawa')] → returns the element. ✅
  2. click_element with the same XPath → -32000 "DOM Error while querying". ❌

Observed this session on unotes.net (school picker).

Workaround

Resolve the target to a CSS selector and click_element that (e.g. div.cursor-pointer.items-center.gap-3.px-4.py-2) — works.

Expected

click_element should accept the same selector grammar query_elements does; a selector that can be queried should also be clickable.

Likely cause

Query and click use different element-resolution paths for text() XPath.

Severity: Medium (papercut; CSS selector works).

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