Find a single element. Override this method if necessary. @param context A context to use to find the element. @return The WebElement that matches the selector.
(SearchContext context)
| 120 | * @return The WebElement that matches the selector. |
| 121 | */ |
| 122 | public WebElement findElement(SearchContext context) { |
| 123 | List<WebElement> allElements = findElements(context); |
| 124 | if (allElements == null || allElements.isEmpty()) { |
| 125 | throw new NoSuchElementException("Cannot locate an element using " + this); |
| 126 | } |
| 127 | return allElements.get(0); |
| 128 | } |
| 129 | |
| 130 | /** |
| 131 | * Find many elements. |
nothing calls this directly
no test coverage detected