Dropdowns
Dropdowns ~10 mins

Handling Dropdown:

What is a drop down?

How to handle dropdown?

When to use?

How to handle Dropdown?

How to use Select class?

  1. Identify the element and confirm with <select>
  2. Instantiate the Select class by passing the WebElement as argument to the constructor.

Syntax:

    Select options =new Select (webElement);

Note: (Select class should be imported from selenium.support.ui.Select)

Method 1

    selectByIndex(index) ;

Method 2

    selectByVisibleText("text");

Method 3

    selectByValue("value");