devxlogo

Selenium WebDriver – Locate Elements by Name

Selenium WebDriver – Locate Elements by Name

Getting elements using their tag names is often used to collect autosuggestions, checkboxes, ordered lists, and so on. The following line of code is an example of capturing elements trough the tagName function:

List link =  driver.findElement(By.locatorType("path")).findElements(By.tagName("li"));

devx-admin

Share the Post: