Both of these methods allow automation
tester to find the WebElement on the page
WebElement findElement(By by)
- Finds the first matching element.
- Throws NoSuchElementException if matching element with the specified locator is not found.
- When implicitly waiting, The findElement invocation will return a matching row, or try again repeatedly until the configured timeout is reached.
Difference between findElement and findElements in Selenium?
List<WebElement> findElements(By by)
- Returns all the matching elements.
- Returns an empty list if no matching elements found
- No exception will be thrown if elements not found.
implicitly waiting, this method will return as soon as there are more than 0
items in the found collection, or will return an empty list if the timeout is