添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
风流的书签  ·  vue-element-admin项目中ta ...·  1 月前    · 
绅士的长颈鹿  ·  yarn run + npm ...·  2 月前    · 
聪明的海龟  ·  Recherche·  2 月前    · 
买醉的小熊猫  ·  开放平台·  4 月前    · 
Remote Protocol
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.
Status: UNCONFIRMED → NEW
Component: geckodriver → Marionette
Ever confirmed: true
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.
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 ::

1638879298664	Marionette	DEBUG	3 -> [0,3,"WebDriver:FindElement",{"value":"vaadinLoginUsername","using":"id"}]
1638879298787	Marionette	TRACE	[22] MarionetteCommands actor created for window id 2147483650
1638879298794	Marionette	DEBUG	3 <- [1,3,null,{"value":{"element-6066-11e4-a52e-4f735466cecf":"14499b12-ec8d-410f-b77d-a563d190515e"}}]
1638879298799	Marionette	DEBUG	3 -> [0,4,"WebDriver:GetShadowRoot",{"id":"14499b12-ec8d-410f-b77d-a563d190515e"}]
1638879298812	Marionette	DEBUG	3 <- [1,4,null,{"value":{"shadow-6066-11e4-a52e-4f735466cecf":"6cae4c3e-3e09-4c1f-90da-f18d76ca137e"}}]
1638879298830	Marionette	DEBUG	3 -> [0,5,"WebDriver:ExecuteScript",{"script":"var elem = document.getElementById(\"vaadinLoginUsername\");\n            return elem.shadowRoot;","args":[],"newSandbox":true,"sandbox":"default","line":108,"filename":"_a/test_minimized.py"}]
1638879298836	Marionette	DEBUG	3 <- [1,5,null,{"value":{"shadow-6066-11e4-a52e-4f735466cecf":"6cae4c3e-3e09-4c1f-90da-f18d76ca137e"}}]

Note that geckodriver support for this will ship in the upcoming 0.31.0 release.

Assignee: nobody → david.burns
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch