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

Method FindElement

dotnet/src/webdriver/By.cs:324–332  ·  view source on GitHub ↗

Finds the first element matching the criteria. An object to use to search for the elements. The first matching on the current context. If no element matches the criteria.

(ISearchContext context)

Source from the content-addressed store, hash-verified

322 /// <returns>The first matching <see cref="IWebElement"/> on the current context.</returns>
323 /// <exception cref="NoSuchElementException">If no element matches the criteria.</exception>
324 public virtual IWebElement FindElement(ISearchContext context)
325 {
326 if (this.FindElementMethod is not { } findElementMethod)
327 {
328 throw new InvalidOperationException("FindElement method not set. Override the By.FindElement method, set the By.FindElementMethod property, or use a constructor that sets a query mechanism.");
329 }
330
331 return findElementMethod(context);
332 }
333
334 /// <summary>
335 /// Finds all elements matching the criteria.

Callers 1

ByMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected