mozilla / geckodriver

WebDriver for Firefox
https://firefox-source-docs.mozilla.org/testing/geckodriver/
Mozilla Public License 2.0
7.03k stars 1.51k forks source link

Shadow Root Location Error for XPath #2105

Closed titusfortner closed 1 year ago

titusfortner commented 1 year ago

When attempting to locate an element in a Shadow Root with XPath it results in an "invalid argument" error.

Selenium received a PR to prevent users from using XPath for shadow roots (https://github.com/SeleniumHQ/selenium/pull/11893)

I would prefer not to have custom Selenium errors for things drivers do not (yet?) support. Would it be possible for the driver to give a more clear error, perhaps a "unsupported operation" error with a message about XPath not working?

titusfortner commented 1 year ago

Oops, Chrome not Firefox. I'll raise a new error once I run on nightly 😉

whimboo commented 1 year ago

Probably it should be discussed over on https://github.com/w3c/webdriver/issues/1610 first if it will be fine to raise a unsupported operation error in those cases. That way we will have an agreement and each driver could behave the same. Shall we close this issue for now?

titusfortner commented 1 year ago

I thought I had closed it. Thanks for raising in w3c.