Get Element Property should JSON serialise its response value



a month ago
27 days ago


(Reporter: surkov, Unassigned)


(Blocks 2 bugs)

Version 3
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)



(2 attachments, 2 obsolete attachments)



a month ago

all find_element strategies don't work on shadow DOM, marionette had some initial shadowDOM support [1] in design but it seems not implemented [2]. It appears current way to deal with shadow DOM testing is executing a script [3]. So it might be a good working alternative to extend find_element to specify a property to call.


Blocks: webdriver
Type: defect → enhancement
Priority: -- → P3
Summary: extend marionette find_element to call a property → Get Element Property should JSON serialise its response value

I looked into why evaluate.toJSON(els[name], seenEls) in listener.js
didn’t work as asurkov reported in, and my
suspicion was correct, that Get Element Property fails to operate
on the document as mutated by Execute Script. I’ve filed to write some
more detailed tests for this.

Depends on: 1546319

A WPT tests that exemplifies the issue:

def test_element(session):
    session.url = inline("""

        const [foo, bar] = document.querySelectorAll("p"); = bar;
    [foo, bar] = session.find.css("p")

    response = get_element_property(session,, "bar")
    value = assert_success(response)
    assert_same_element(session, value, bar)

Here we would expect the returned value to be a web element equal to bar.

Nothing remarkable in this patch.

There are approximately zero coverage for properties modified or set
by web content and through script evaluation. The only succcess
path test for Get Element Property is test_element, but it checks
an attribute already present in the prototype of the HTMLInputElement.

This patch adds tests where the property is defined through web
content. This uncovers a defect in Firefox, where Get Element
Property seemingly operates on the initial value of the attribute.

Attachment #9060046 - Attachment is obsolete: true
Attachment #9060047 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.