Closed
Bug 1502307
Opened 6 years ago
Closed 6 years ago
Marionette reports textfield in Shadow DOM not accessible
Categories
(Remote Protocol :: Marionette, defect, P3)
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 1503860
People
(Reporter: pascal, Unassigned)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:63.0) Gecko/20100101 Firefox/63.0
Steps to reproduce:
When trying to send text to a textfield embedded in a web component (shadow dom), the driver refuses with an org.openqa.selenium.ElementNotInteractableException, while in fact the element is interactable in the browser.
System
Version: geckodriver 0.23
Platform: macOS 10.12.6
Firefox: 63.0
Selenium: 3.14.0
# Testcase using Selenium/Java bindings and Geckodriver
WebDriver driver = new FirefoxDriver();
driver.get("https://pbi-qfs.github.io/selenium-demos/shadowdom/attachShadow_only.html");
Thread.sleep(1000); // just to be sure all js work in setting up the web components is done
// Access text field in shadow DOM
final WebElement element = (WebElement)((JavascriptExecutor)driver).executeScript("return document.getElementsByTagName(\"my-element\")[0].shadowRoot.getElementsByTagName(\"input\")[0]");
element.sendKeys("Text"); // Throws org.openqa.selenium.ElementNotInteractableException: Element <input id="shadow-text-inside" type="text"> is not reachable by keyboard
Actual results:
# Trace-level log
...
INFORMATION: Detected dialect: W3C
1540550410194 webdriver::server DEBUG -> POST /session/cc7da5a9-7538-ae44-89dd-553171554281/url {
"url": "https:\u002f\u002fpbi-qfs.github.io\u002fselenium-demos\u002fshadowdom\u002fattachShadow_only.html"
}
1540550410199 Marionette TRACE 0 -> [0,2,"WebDriver:Navigate",{"url":"https://pbi-qfs.github.io/selenium-demos/shadowdom/attachShadow_only.html"}]
1540550410204 Marionette DEBUG [4294967297] Received DOM event beforeunload for about:blank
1540550410323 Marionette DEBUG [4294967297] Received DOM event pagehide for about:blank
1540550410463 Marionette DEBUG [4294967297] Received DOM event DOMContentLoaded for https://pbi-qfs.github.io/selenium-demos/shadowdom/attachShadow_only.html
1540550410466 Marionette DEBUG [4294967297] Received DOM event pageshow for https://pbi-qfs.github.io/selenium-demos/shadowdom/attachShadow_only.html
1540550410467 Marionette TRACE 0 <- [1,2,null,{"value":null}]
1540550410469 webdriver::server DEBUG <- 200 OK {"value":null}
1540550411479 webdriver::server DEBUG -> POST /session/cc7da5a9-7538-ae44-89dd-553171554281/execute/sync {
"script": "return document.getElementsByTagName(\"my-element\")[0].shadowRoot.getElementsByTagName(\"input\")[0]",
"args": [
]
}
1540550411481 Marionette TRACE 0 -> [0,3,"WebDriver:ExecuteScript",{"args":[],"newSandbox":false,"script":"return document.getElementsByTagName(\"my-element\")[0].shadowRoot.getElementsByTagName(\"input\")[0]","specialPowers":false}]
1540550411485 Marionette TRACE 0 <- [1,3,null,{"value":{"element-6066-11e4-a52e-4f735466cecf":"e7c7adab-7869-1945-851b-659d5d162f4d"}}]
1540550411485 webdriver::server DEBUG <- 200 OK {"value":{"element-6066-11e4-a52e-4f735466cecf":"e7c7adab-7869-1945-851b-659d5d162f4d"}}
[org.openqa.selenium.remote.RemoteWebElement@7f314ac3 -> unknown locator]
1540550411493 webdriver::server DEBUG -> POST /session/cc7da5a9-7538-ae44-89dd-553171554281/element/e7c7adab-7869-1945-851b-659d5d162f4d/value {
"id": "e7c7adab-7869-1945-851b-659d5d162f4d",
"text": "Text",
"value": [
"T",
"e",
"x",
"t"
]
}
1540550411494 Marionette TRACE 0 -> [0,4,"WebDriver:ElementSendKeys",{"id":"e7c7adab-7869-1945-851b-659d5d162f4d","text":"Text","value":["T","e","x","t"]}]
1540550411500 Marionette TRACE 0 <- [1,4,{"error":"element not interactable","message":"Element <input id=\"shadow-text-inside\" type=\"text\"> is not reachable ... ch/</req<@chrome://marionette/content/listener.js:482:14\ndispatch/<@chrome://marionette/content/listener.js:477:15\n"},null]
1540550411504 webdriver::server DEBUG <- 400 Bad Request {"value":{"error":"element not interactable","message":"Element <input id=\"shadow-text-inside\" type=\"text\"> is not reachable by keyboard","stacktrace":"WebDriverError@chrome://marionette/content/error.js:178:5\nElementNotInteractableError@chrome://marionette/content/error.js:286:5\nwebdriverSendKeysToElement@chrome://marionette/content/interaction.js:566:11\ninteraction.sendKeysToElement@chrome://marionette/content/interaction.js:553:11\nsendKeysToElement@chrome://marionette/content/listener.js:1307:9\ndispatch/</req<@chrome://marionette/content/listener.js:482:14\ndispatch/<@chrome://marionette/content/listener.js:477:15\n"}}
Exception in thread "main" org.openqa.selenium.ElementNotInteractableException: Element <input id="shadow-text-inside" type="text"> is not reachable by keyboard
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:05:20.749Z'
System info: host: 'Elektrik.local', ip: '10.99.0.1', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_172'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 63.0, javascriptEnabled: true, moz:accessibilityChecks: false, moz:geckodriverVersion: 0.23.0, moz:headless: false, moz:processID: 61198, moz:profile: /var/folders/j3/glwdgbj17jl..., moz:useNonSpecCompliantPointerOrigin: false, moz:webdriverClick: true, pageLoadStrategy: normal, platform: MAC, platformName: MAC, platformVersion: 16.7.0, rotatable: false, setWindowRect: true, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
Session ID: cc7da5a9-7538-ae44-89dd-553171554281
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:548)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:276)
at org.openqa.selenium.remote.RemoteWebElement.sendKeys(RemoteWebElement.java:100)
Expected results:
The text should be set.
Comment 1•6 years ago
|
||
Shadow DOM support hasn't been added to the WebDriver spec yet. A first proposal is up on https://github.com/w3c/webdriver/pull/1320.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3
Comment 2•6 years ago
|
||
Duping to bug 1503860 because it has a better description.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
Updated•2 years ago
|
Product: Testing → Remote Protocol
You need to log in
before you can comment on or make changes to this bug.
Description
•