top of page

Difference between findElement() and findElements()

hence, loc means Locator

findElement(loc) ----> returns WebElement

findElements(loc) ----> return type List<WebElement>


Scenario1: locator is matching with single web element.

------- returns return type

findElement(loc) ---->single webelement WebElement

findElements(loc)--->single webelement List<WebElement>


Scenario2: locator is matching with multiple web elements

------------------

findElement(loc)---->single webelement(first) WebElement

findElements(loc) ---> multiple web elements List<WebElement>


Scenario3: locator is incorect ( No elements are not matching with locator)

------

findElement(loc)----> NoSuchElementException

findElements(loc)--->returns zero


 
 
 

Recent Posts

See All

Comments


MiIT Logo

Company

Contact Us

+1905-487-4880 

5160 Explorer Dr #34, Mississauga,ON L4W 4T7

+1929-743-3199

4466 Buttonwood Ln Lilburn, GA 30047

262 Chapman Rd, STE 240 Newark DE 19702

+44 20 4525 1214

71-75 Shelton Street, Covent Garden, London, United Kingdom WC2H 9JQ

Stay up to date on the latest from MiIT

  • Instagram
  • Facebook
  • http://linkedin.com/company/miittechnologies/about/
  • Whatsapp

© All Content MiIT Technologies Inc.2019 - 2025. All rights reserved.

bottom of page