Open Bug 1822311 Opened 2 years ago Updated 1 year ago

Add support for "xpath" strategy for "WebDriver:FindElementFromShadowRoot" and "WebDriver:FindElementsFromShadowRoot" commands

Categories

(Remote Protocol :: Marionette, task, P3)

task

Tracking

(Not tracked)

People

(Reporter: Sasha, Unassigned)

References

(Blocks 1 open bug)

Details

As soon as shadow root supports xpath search, we should be able to have the support for xpath strategy in WebDriver:FindElementFromShadowRoot and WebDriver:FindElementsFromShadowRoot commands, most likely we would need only to enable the wpt tests: https://searchfox.org/mozilla-central/source/testing/web-platform/tests/webdriver/tests/find_element_from_shadow_root/find.py#156 and https://searchfox.org/mozilla-central/source/testing/web-platform/tests/webdriver/tests/find_elements_from_shadow_root/find.py#157.

Summary: Add support for `xpath` strategy for "WebDriver:FindElementFromShadowRoot" and "WebDriver:FindElementsFromShadowRoot" → Add support for "xpath" strategy for "WebDriver:FindElementFromShadowRoot" and "WebDriver:FindElementsFromShadowRoot" commands
Blocks: 1686180

So this is a limitation by the HTML spec, right? Is there maybe any open issue where a discussion for that topic might have happened?

(In reply to Henrik Skupin [:whimboo][⌚️UTC+1] from comment #1)

So this is a limitation by the HTML spec, right? Is there maybe any open issue where a discussion for that topic might have happened?

I didn't find, unfortunately, anything.

Whiteboard: [webdriver:triage]

XPath is deprecated and shouldn't change anymore. https://www.w3.org/TR/DOM-Level-3-XPath/ is also retired and should not be used anymore.

Based on wpt.fyi results all browsers are failing here.

James, shall we add a notice to the appropriate APIs in the WebDriver classic spec that XPath locators will not be supported within ShadowRoot searches? Then we can also close this bug as wontfix.

Flags: needinfo?(james)
Whiteboard: [webdriver:triage]

I think that's correct per spec at the moment. If there's pushback from WebDriver users (which would be understandable) we should revisit what's possible with the WG.

Flags: needinfo?(james)
Priority: -- → P3

Here is the related WebDriver classic specification issue: https://github.com/w3c/webdriver/issues/1610

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