• +91 9723535972
  • info@interviewmaterial.com

Selenium Interview Questions and Answers

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));

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners