-
Notifications
You must be signed in to change notification settings - Fork 2
5. Working with DropDown Select Operations
NaveenS edited this page Mar 27, 2020
·
9 revisions

Select is a class which is provided by Selenium to perform operations on DropDown object. This class can be found under the Selenium’s selenium.webdriver.support.ui module.
from selenium.webdriver.support.ui import Select
Declare the drop-down element as an instance of the Select class
fromaccele=driver.find_element_by_xpath("//*[@id='tf_fromAccountId']")
fromaccselect=Select(fromaccele)
Can Handle Drop Down by following types of Select Methods.
fromaccselect.select_by_visible_text("Loan(Avail. balance = $ 780)")
-
select_by_index(index) - Select the option at the given index counting
-
select_by_value(value) - Select all options that have a value matching the argument
-
select_by_visible_text(text) - Select all options that display text matching the argument
Refer transferfund_scenario.py file
By using Select class
options = select.options