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

Method FindElement

dotnet/src/webdriver/RelativeBy.cs:69–78  ·  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 is not or wraps a driver that does.</exc

(ISearchContext context)

Source from the content-addressed store, hash-verified

67 /// <returns>The first matching <see cref="IWebElement"/> on the current context.</returns>
68 /// <exception cref="ArgumentException">If <paramref name="context"/> is not <see cref="IJavaScriptExecutor"/> or wraps a driver that does.</exception>
69 public override IWebElement FindElement(ISearchContext context)
70 {
71 ReadOnlyCollection<IWebElement> elements = FindElements(context);
72 if (elements.Count == 0)
73 {
74 throw new NoSuchElementException("Unable to find element");
75 }
76
77 return elements[0];
78 }
79
80 /// <summary>
81 /// Finds all elements matching the criteria.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected