Unable to access input elements under shadow root with driver.inputFile()
See original GitHub issueHi, I’m a little new to contributing to open source so wasn’t super sure how to get started based off the info provided in the wiki (Do I make a new branch or should I fork everything then make a PR to develop? etc. Just want to make sure I’m following the proper process)
Regardless, I ran into the same issue as https://stackoverflow.com/questions/65401960/upload-file-using-vaadin-upload-component and realized vaadin-upload/input elements are always placed into the shadowRoot. After looking into the source code, I saw that driver.inputFile()
locates the element using elementId()
, which in turn calls getRootNodeId()
, which finally calls method("DOM.getDocument")
here. Looking at the Chrome DevTools Protocol there’s an optional parameter pierce
that determines whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).
My idea was to add and set pierce
to true
to make elements in iframes/shadow roots available and allow those selectors to be located when using the driver.inputFile()
method.
With this in mind I have two questions:
- Does this make sense?
- How can I help add/do this?
Thanks!
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
@eeelinn this totally makes sense, and please submit a PR: https://github.com/intuit/karate/blob/master/.github/CONTRIBUTING.md
I would request that you add a test to the suite we have, and there is one flow already for a Chrome file-upload, within an iframe: https://github.com/intuit/karate/blob/v1.1.0.RC5/karate-e2e-tests/src/test/java/driver/08.feature - it may make sense to create a new test for shadow dom complications in general.
@eeelinn awesome. this means I’ll probably release 1.1.0 right away.
if you have ideas for long term making shadow-dom traversal easier do consider contributing + discussing, thx !