How to find more than one web element in to a list?
Watch the answer for this Selenium Interview Question in a detailed manner in the below youtube video:
Note: Don’t forget to subscribe to my Youtube channel here: Click here
Notes used for explanation in this Youtube video are provided after the video:
Notes used in the above Youtube Video:
findElements() command in WebDriver can be used to find more than one web elements and save them into a list.
To add more value to the answer:
- > If the provided value has the possibility to locate a single element, we can use findElement() command and save them into a variable of WebElement
- > If the provided locator has the possibility to locate multiple elements, we can use findElements() command and save them into a list of WebElement’s i.e. List<WebElement>
- > For more Selenium Interview Questions and answers, continue to the next post (Click on Next Post link below)
- > Check complete Selenium Interview Questions list here (Click here)
Please leave your questions/comments/feedback below.
Happy Learning 🙂