A Select function allows you select or deselect values from a drop-down box or a radio button. It includes a list of Selenium API methods to work with select boxes that contain the
</select> tags. These functions interact with the UI comboboxes to select options.
Select select = new Select(driver.findElement(By.locatorType("path")));
Some helpful snippets using
select functions are given below:
selectByIndex(index)method selects an option using the
indexvalue. The following is the syntax for this function:
Let's get into the bookstore and select a product from a drop-down list. Here, we select the products at the top of the options list using the