Home > Automation Testing > Difference between find element and find elements in Selenium

Difference between find element and find elements in Selenium

This post was most recently updated on June 14th, 2019

Difference between find element and find elements.

findElement()

findElements()

findElement() method used to access single web element

findElements() method used to access multiple web elements.

findElement() method returns first matching web element

findElements() method returns list of all matching web elements

If there is no matching web element then findElement() method throws exception

If there is no matching web element then findElements() method returns empty list

Usage of findElement() method:

Usage of findElements() method:

 

Selenium Tutorial >>

This Article is TAGGED in , . BOOKMARK THE permalink.

Avatar photo
Amit Bharamasali
Automation Software Test Engineer. Skills: Manual Testing, Selenium, Java, Protractor, JavaScript, Katalon Studio, Groovy, Appium, Sahi, Sahi Script and UI/UX testing.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">