Handling HTML Drop-down fields
- Select class is the predefined class in Selenium WebDriver and it has predefined methods for performing various operations on Drop-down fields
- We can use the below commands:
- selectByVisibleText()
- selectByIndex()
- selectByValue()
- deselectByVisibleText() – Not applicable for dropdown fields
- deselectByIndex() – Not applicable for dropdown fields
- deselectByValue() – Not applicable for dropdown fields
- isMultiple()
- getOptions()
Handling Multi-selection box (List Box) fields
- Select class is the predefined class in Selenium WebDriver and it has predefined methods for performing various operations on Multi-selection box fields
- We can use the below commands:
- selectByVisibleText()
- selectByIndex()
- selectByValue()
- deselectByVisibleText()
- deselectByIndex()
- deselectByValue()
- deselectAll()
- isMultiple()
- getOptions()
- getAllSelectedOptions()
- getFirstSelectedOption()
Generic Function to handle HTML dropdown fields in Selenium
- Practical Demonstration – https://letcode.in/dropdowns
Handling Bootstrap Drop-downs
- What is a Bootstrap Dropdown
- W3Schools Bootstrap dropdown
- Practical Demonstration
- hdfc netbanking
- Creating a Generic Method
Handling JQuery Drop-downs
Handling Auto-suggestive Dropdowns
- We can type text into Auto-suggestive drop-down fields in-order to filter the drop-down results
- Demonstrating selecting an option from the Auto-Suggestive Dropdowns
By,
Arun Motoori