HomeSelenium

Handling HTML Drop-down, Multi-selection box, Bootstrap, JQuery and Auto-suggestive dropdown fields (Selenium 4 – Session 19)


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


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

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *

For FREE Testing Tutorials & Videos

X
Open chat
Contact Us on Whatsapp