How to Select Option from Drop Down using Selenium Webdriver?

We can select Option from Dropdown in selenium by three ways. Drop down is also main part of form where user choose one option from dropdown. See below code that will show in detail that how can you choose dropdown option with different ways.

Select Option from DropDown using Selenium Webdriver

    1. Select By Visible Text
    2. Select By Value
    3. Select By Index

During choose a option from dropdown first we have to wait till fully dropdown element is not loaded. Given ensure wait till 28 second you can also increase time limit according to your condition.

 

1. Select By Visible Text

We can choose a option from Dropdown by text that should be visible during choose. i have create a reusable funtion that also use WaitForDropDown funtions and we have to pass driver object and option text or you can just use the code directly to your test script.

2. Select By Value

This option choose option by your value. you need to pass driver and value of option.

3. Select By Index

This method allows you to choose option by index from dropdown.