Open Bug 1503860 Opened 1 year ago Updated 7 months ago

ElementNotInteractableException when using sendKeys on an input type=file inside a shadow root

Categories

(Testing :: Marionette, defect, P5)

defect

Tracking

(Not tracked)

People

(Reporter: artur, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36

Steps to reproduce:

1. Have a page with a `<input type=file>` directly in the body and another one inside a shadow root
2. Use WebDriver to upload a file to the input in the body
3. Use WebDriver to upload a file to the input in the shadow root


Actual results:

Setting the file name for the input in the body succeeds.
Setting the file name for the input in the shadow root (`        uploadInBody.sendKeys(file1.getPath());`) fails with "ElementNotInteractableException"


Expected results:

`sendKeys` should work the same when the input is inside a shadow root
Can be reproduced using https://github.com/Artur-/selenium-firefox-shadowdom
WebDriver doesn’t really support shadow DOM yet, so that would have
to be addressed first.

There’s more discussion about this in
https://github.com/w3c/webdriver/pull/1320.
Status: UNCONFIRMED → NEW
Component: Untriaged → Marionette
Ever confirmed: true
Priority: -- → P5
Product: Firefox → Testing
Version: 63 Branch → Trunk
Duplicate of this bug: 1502307

FWIW, not being able to query shadow DOM in webdriver is a separate issue to not being able to send keys to shadowRoot input elements. I'm currently getting the input from an element's shadow dom by leveraging a raw script:

return arguments[0].shadowRoot.querySelectorAll('input')

I can then convert the result back into an element, and send keys to it (works fine in Chrome, errors in Firefox).

(In reply to lukebjerring from comment #4)

FWIW, not being able to query shadow DOM in webdriver is a separate issue to not being able to send keys to shadowRoot input elements. I'm currently getting the input from an element's shadow dom by leveraging a raw script:

return arguments[0].shadowRoot.querySelectorAll('input')

I can then convert the result back into an element, and send keys to it (works fine in Chrome, errors in Firefox).

This sounds like Chrome is not actually doing the interactability checks properly as the mechanisms the spec uses have not had behaviour defined when looking into it.

E.g. document.elementFromPoint(x, y) will return the shadowRoot element and not the element defined inside the shadowRoot

Duplicate of this bug: 1574497
You need to log in before you can comment on or make changes to this bug.