Skip to content

get-element-text-el returning empty string when it shouldn't #707

@Outrovurt

Description

@Outrovurt

Version
1.1.43

Platform
Operating System: Arch Linux
Clojure version: 1.11.1
JDK vendor and version: openjdk 17.0.13 2024-10-15

Browser vendor: chrome
Browser version: [browser version]
WebDriver version: [webdriver version]

Symptom
I call the following two statements:

(get-element-property-el driver elt "innerText")
;; "BlockGrid"

(get-element-property-el driver elt "innerText")
;; "<td><span>BlockGrid</span></td>"

(get-element-text-el driver elt)
;; ""

So get-element-property-el correctly returns the correct innerText and outerHTML properties of the element.

But then get-element-text-el returns an empty string for the text of the element, even though it runs after the calls to get-element-property-el.

Expected behavior
I would expect get-element-text-el to return exactly the same value as (get-element-property-el driver elt "innerText") always, no matter what, especially if run in the order shown above.

Diagnosis
The call is the result of finding elements using query-all-from, but I haven't found any reason why this might happen. There definitely aren't any stale elements involved otherwise none of the calls would work. There is nothing in the documentation for get-element-text-el that might explain this either.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions