The Firefox Remote Protocol is a low-level debugging interface based on the CDP protocol. With it, you can inspect the state and control execution of documents running in web content, instrument Gecko in interesting ways, simulate user interaction for automation purposes, and debug JavaScript execution
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.
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.
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?
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)
i'm working on FF 63.0.3 (64-bit). I'm getting the same problem. kindly provide the updates on this.
We have the same error with RobotFramework and SeleniumLibrary, we can qualified our products on Chrome but not on Firefox.
OS: Linux x64
GeckoDriver: 0.26.0
Firefox: 77.0.1
This works as expected now in Firefox Nightly and should also do in the upcoming Firefox 96 beta since the patch from
bug 1700073
has been landed. Here the excerpt of the trace log for the test case as mentioned in
comment 0
::