w3c / w3c/webdriver

Get Element(s) from Shadow root 'using' xpath and tagname property

Open
#1,610 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Find Element From Shadow Root Find Elements From Shadow Root needs-discussion
Dominant language
HTML
Stars
718
Forks
228
PR merge metrics
No merged PRs in 30d

Description

According to the documentation:
https://w3c.github.io/webdriver/#find-element-from-shadow-root step 2
https://w3c.github.io/webdriver/#find-elements-from-shadow-root step 2

the value for using has to be one of the Locator strategies table.
But for what I can see in https://dom.spec.whatwg.org/ there no method to get elements from a tag name in a shadow root.

Experimenting in Chromium and Firefox I can neither use xpath in a shadow root. For the xpath I'm not sure if is because is not defined in the standard or because they don't have it implemented, but right now is not supported.

For more context you can take a look to this thread in the WPT repository

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the shadow-root find-element and find-elements steps in the WebDriver specification with the locator strategies table and the DOM specification. Review the linked WPT discussion for existing implementation context, then clarify whether tag-name and XPath strategies are specified or supported for shadow roots. Done means the specification and expected browser behavior are unambiguous.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
api, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.