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

Method FindElements

dotnet/src/webdriver/By.cs:340–348  ·  view source on GitHub ↗

Finds all elements matching the criteria. An object to use to search for the elements. A of all WebElements matching the current criteria, or an empty list if nothing matches.

(ISearchContext context)

Source from the content-addressed store, hash-verified

338 /// <returns>A <see cref="ReadOnlyCollection{T}"/> of all <see cref="IWebElement">WebElements</see>
339 /// matching the current criteria, or an empty list if nothing matches.</returns>
340 public virtual ReadOnlyCollection<IWebElement> FindElements(ISearchContext context)
341 {
342 if (this.FindElementsMethod is not { } findElementsMethod)
343 {
344 throw new InvalidOperationException("FindElements method not set. Override the By.FindElements method, set the By.FindElementsMethod property, or use a constructor that sets a query mechanism.");
345 }
346
347 return findElementsMethod(context);
348 }
349
350 /// <summary>
351 /// Gets a string representation of the finder.

Callers 3

ByMethod · 0.45
OnScriptBindingCalledMethod · 0.45
FrameMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected