Selenium WebDriver Tutorial #18 – How to Handle Dropdown in Selenium – Part 2

In this Selenium Webdriver Tutorial, we will learn How to Handle Dropdown in Selenium WebDriver, I will walk through with examples for handling multi-select dropdowns.

In this part-2 of the handling dropdown tutorial, we will learn about the following methods in the Select class of Selenium WebDriver.

✅ selectByIndex(int index) – Select the option at the given index.

✅ selectByValue(java.lang.String value) – Select all options that have a value matching the argument.

✅ selectByVisibleText(java.lang.String text) – Select all options that display text matching the argument.

✅ deselectAll() – Clear all selected entries.

✅ deselectByIndex(int index) – Deselect the option at the given index.

✅ deselectByValue(java.lang.String value) – Deselect all options that have a value matching the argument.

✅ deselectByVisibleText(java.lang.String text) – Deselect all options that display text matching the argument.

✅ getAllSelectedOptions()