Adobe
0
Q:

find element vs find elements

Differences between findElement and findElementS method?
    --> findElement():
     
      -It does returns SINGLE web element.
      - Return type: WebElement
      - If it cannot find a web element, it throw - NoSuchElementException
          
   
   --> findElements():
      - Returns a List of WebElements
      - Return type: List<WebElement>
      - If it cannot find a web element, - It will not throw any exception.
      - It will simply return EMPTY LIST.
1
Differences between findElement and findElementS method?
    --> findElement():
     
      -It does returns SINGLE web element.
      - Return type: WebElement
      - If it cannot find a web element, it throw - NoSuchElementException
          
   
   --> findElements():
      - Returns a List of WebElements
      - Return type: List<WebElement>
1

New to Communities?

Join the community