Skip to content
This repository was archived by the owner on Sep 20, 2019. It is now read-only.
This repository was archived by the owner on Sep 20, 2019. It is now read-only.

"TypeError: cyclic object value" when returning a list of shady DOM elements from a script in Selenium #217

Closed
@Artur-

Description

@Artur-

Description

When using Selenium and returning a list of elements from JavascriptExecutor.executeScript, it would seem that they are encoded more or less as JSON.stringify([element1, element2]). When any of the elements is inside a shadow root, this will fail with "TypeError: cyclic object value".

Live Demo

http://jsbin.com/gasepupuje/edit?html,console,output

Steps to Reproduce

  1. Create div
  2. Create span
  3. Append span to div
  4. Run JSON.stringify(div)
  5. Append div to a shadow root
  6. Run JSON.stringify(div)

Expected Results

Expected result would be {} both before and after the div has been attached. Acceptable result would be {"__shady":{}}

Actual Results

In Chrome and Safari TP, the result is {}, both before the div is attached and after
In Firefox and IE11, the result is {"__shady":{}} before the 'div' is attached to the shadow root and TypeError: cyclic object value in Firefox or Circular reference in value argument not supported in IE after it is attached

Browsers Affected

  • Chrome
  • Firefox
  • Edge
  • Safari 9
  • Safari 8
  • IE 11

Versions

  • webcomponents: v1.1.0 (master used in jsbin)

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