Looping Through WebElements
Looping through list of web elements
As discussed sometimes list of web elements have advantages over identifying a single element.
List of web elements is essentially a java.util.List of WebElement interface, i.e., we can leverage all that we can do on a normal java list, like Filtering, sorting, getting element at desired index, etc.,
Examples:
Getting element at a desired index
Filtering only visible elements in list of elements:
Filtering only elements which contain certain text :
Last updated