19 November, 2014

What is the difference between 'findElement' and 'findElements' ?

findElement : It is used to find the first element in the current web-page.Only the matching value will be fetched.It returns a web-element from the page which is find in first attempt otherwise it throws an exception.
                    
findElements: It is used to find all the elements in the current web page. All the matching elements will be fetched and stores in the list of web-elements.It returns a list of web-elements from the page. It can return an empty list if no DOM elements match the query.

No comments:

Post a Comment