MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / FindElements

Method FindElements

dotnet/src/webdriver/ShadowRoot.cs:109–123  ·  view source on GitHub ↗

Finds all IWebElements within the current context using the given mechanism. The locating mechanism to use. A of all WebElements matching the current criteria, or an empty list if nothing matches. If

(By by)

Source from the content-addressed store, hash-verified

107 /// matching the current criteria, or an empty list if nothing matches.</returns>
108 /// <exception cref="ArgumentNullException">If <paramref name="by"/> is <see langword="null"/>.</exception>
109 public ReadOnlyCollection<IWebElement> FindElements(By by)
110 {
111 if (by is null)
112 {
113 throw new ArgumentNullException(nameof(by), "by cannot be null");
114 }
115
116 Dictionary<string, object?> parameters = new Dictionary<string, object?>();
117 parameters.Add("id", this.shadowRootId);
118 parameters.Add("using", by.Mechanism);
119 parameters.Add("value", by.Criteria);
120
121 Response commandResponse = this.driver.Execute(DriverCommand.FindShadowChildElements, parameters);
122 return this.driver.GetElementsFromResponse(commandResponse);
123 }
124
125 Dictionary<string, object> IWebDriverObjectReference.ToDictionary()
126 {

Callers

nothing calls this directly

Calls 3

AddMethod · 0.45
ExecuteMethod · 0.45

Tested by

no test coverage detected