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)
| 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. |
nothing calls this directly
no outgoing calls
no test coverage detected