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

Method FindElements

dotnet/src/webdriver/By.cs:333–341  ·  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

331 /// <returns>A <see cref="ReadOnlyCollection{T}"/> of all <see cref="IWebElement">WebElements</see>
332 /// matching the current criteria, or an empty list if nothing matches.</returns>
333 public virtual ReadOnlyCollection<IWebElement> FindElements(ISearchContext context)
334 {
335 if (this.FindElementsMethod is not { } findElementsMethod)
336 {
337 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.");
338 }
339
340 return findElementsMethod(context);
341 }
342
343 /// <summary>
344 /// 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