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.

    Advertisements

    Leave a Reply

    Fill in your details below or click an icon to log in:

    WordPress.com Logo

    You are commenting using your WordPress.com account. Log Out / Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out / Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out / Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out / Change )

    Connecting to %s