Open
Description
What happened?
The By
type has special handling in many cases for custom methods. We use it to make sure FindElements(By.Id(""))
returns an empty list instead of throwing. Users can also override By.FindElementMethod
and By.FindElementsMethod
for custom implementations.
This has been applied to WebDriver
and WebElement
, but not to ShadowRoot
. We can apply it there as well so By
behaves consistently.
How can we reproduce the issue?
driver.Url = shadowRootPage;
IWebElement element = driver.FindElement(By.CssSelector("custom-checkbox-element"));
ISearchContext shadowRoot = element.GetShadowRoot();
Assert.That(shadowRoot.FindElements(By.Id("")), Is.Empty);
Relevant log output
N/A
Operating System
N/A
Selenium version
4.29
What are the browser(s) and version(s) where you see this issue?
N/A
What are the browser driver(s) and version(s) where you see this issue?
N/A
Are you using Selenium Grid?
No response