"TypeError: cyclic object value" when returning a list of shady DOM elements from a script in Selenium #217
Description
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
- Create
div
- Create
span
- Append
span
todiv
- Run
JSON.stringify(div)
- Append
div
to a shadow root - 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)