Skip to content

It should not be required that elements are JSON serializable #1241

Open
@Artur-

Description

@Artur-

When using the Shady DOM polyfill https://github.com/webcomponents/shadydom you will hit TypeError: cyclic object value when trying to return a list of elements from an execute script call (see webcomponents/shadydom#217).

It seems that webdrivers internally use JSON.stringify on the list of elements to return, which in turn runs JSON.stringify on the elements inside the list. While this works fine for the standard case, the Shady DOM polyfill adds a __shady property to the element and at least when the element contains children, the __shady property contains cycles and cannot thus be coverted to JSON. Now this implementation detail of __shady has seemingly absolutely nothing to do with returning an element from a webdriver but because of JSON.stringify, it won't work.

Returning a single element works fine as JSON.stringify does not seem to be used in that case.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions