Open Bug 1489490 Opened Last year Updated 5 months ago

Returning shadowRoot of an element in execute script causes a "cyclic object value" failure

Categories

(Testing :: Marionette, defect, P5)

defect

Tracking

(Not tracked)

People

(Reporter: steffen.harbich, Unassigned)

References

()

Details

Attachments

(1 file)

3.68 MB, application/x-zip-compressed
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0
Build ID: 20180830143136

Steps to reproduce:

With Selenium for Java execute script "return arguments[0].shadowRoot" on a Vaadin Flow application (uses shadow DOM polyfill). Please execute my attached gradle project via "./gradlew test". It opens "https://bakery-flow.demo.vaadin.com/login" and tries to get the "shadowRoot" of the Vaadin text field with id "username". Tested with FF 62, geckodriver v0.21.0-win64, Selenium 3.14.0.

The issue https://bugzilla.mozilla.org/show_bug.cgi?id=1447977 might be related.


Actual results:

An error occurs when running the line

WebElement shadow = (WebElement) ((JavascriptExecutor) driver).executeScript("return arguments[0].shadowRoot", element);

Error:

org.openqa.selenium.JavascriptException: Cyclic object value
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z'
System info: host: 'ITCDENSTHA02', ip: '10.0.75.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_152'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 62.0, javascriptEnabled: true, moz:accessibilityChecks: false, moz:headless: false, moz:processID: 14040, moz:profile: C:\Temp\rust_mozprofile.jzt..., moz:useNonSpecCompliantPointerOrigin: false, moz:webdriverClick: true, pageLoadStrategy: normal, platform: XP, platformName: XP, platformVersion: 10.0, rotatable: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}}
Session ID: 146eed1d-9fc0-410e-9940-7619ee1be94c


Expected results:

The WebElement "shadowRoot" should be returned without errors.
Assignee: nobody → testing
Component: Untriaged → QA Test Scripts
Product: Firefox → Bugzilla
QA Contact: default-qa
Version: 62 Branch → unspecified
Assignee: testing → nobody
Component: QA Test Scripts → geckodriver
Product: Bugzilla → Testing
QA Contact: default-qa
Please note that shadowRoot is not covered by the WebDriver spec yet. As such it will take a bit of time until level 2 of the spec has been discussed. See https://github.com/w3c/webdriver/issues/350 for the ShadowRoot support in general.
Status: UNCONFIRMED → NEW
Component: geckodriver → Marionette
Ever confirmed: true
Summary: "Cyclic object value" execute script in Selenium → Returning shadowRoot of an element in execute script causes a "cyclic object value" failure
Ok. However, as far as I know shadow DOM is not supported in FF 62 and therefor polyfilled by Vaadin Flow. So I would guess that it should be possible to retrieve that attribute "shadowRoot" as WebElement with no special meaning to FF?
For details please see https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM, and I missed that you were using Firefox 62. So, please test again with Firefox 63 which is currently on beta.
Priority: -- → P5
FF 63 is out now and I tested it again, still producing the same problem (see below), even with latest Selenium and gecko drivers. Can you please have a look into it?


org.openqa.selenium.JavascriptException: Cyclic object value
Build info: version: '3.141.0', revision: '2ecb7d9a', time: '2018-10-31T20:09:30'
System info: host: 'ITCDENSTHA02', ip: '10.0.75.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_152'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 63.0.1, javascriptEnabled: true, moz:accessibilityChecks: false, moz:geckodriverVersion: 0.23.0, moz:headless: false, moz:processID: 3640, moz:profile: C:\Temp\rust_mozprofile.rWy..., moz:useNonSpecCompliantPointerOrigin: false, moz:webdriverClick: true, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, platformVersion: 10.0, rotatable: false, setWindowRect: true, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
Session ID: 6e9d62e3-5eec-4cde-af21-c02dd19c2d12
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
	at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
	at org.openqa.selenium.remote.RemoteWebDriver.executeScript(RemoteWebDriver.java:489)
	at se.bettercode.seleniumstarter.MyFirstTest.goToWebPage(MyFirstTest.java:27)
Returning the shadowRoot is not supported in WebDriver.
You need to log in before you can comment on or make changes to this bug.