Mobile QA Zone

A Mobile Application Testing Community

When should I use findElement() and findElements() in my automation script using JAVA and Selenium webdriver ?

Views: 89

Reply to This

Replies to This Discussion

Both findelement() and findelements()  methods are a way to locate elements on a web page, while performing automation using Selenium webdriver. 

  • findelement() : This method is used to locate a single element on the entire web page. It will always return the first matching element. 
  • findelements() : This method is used to locate the list of matching elements on the entire web page. It does not throws NoSuchElementException. It returns an empty list when no matching element is found.

You can find more insight details about  automated testing services at this link. 

Hope I answered your query !!



© 2019   Created by Anurag Khode.   Powered by

Badges  |  Report an Issue  |  Terms of Service

Welcome to Mobile QA Zone, a Next Generation Software Testing Community.Invite your friends to join this community.Write to us to become a featured member.