Question - Explain the difference between findElement() and findElements() in Selenium.
Answer -
Following is the major difference between the two commands:
1.findElement(): command is used for finding a particular element on a web page, it is used to return an object of the first found element by the locator. Eg:
WebElement element = driver.findElement(By.id(example));
2. findElements(): command is used for finding all the elements in a web page specified by the locator value. The return type of this command is the list of all the matching web elements. Eg:
List elementList = driver.findElements(By.id(example));