TestProject Forum
Powered by leading experts in the test automation community

Selecting an <option> with selenium in Python

I need to select a child of a .

I have a reference to the option WebElement I wish to select.
I used click() / select() but they are not working.

What’s the proper method to select ?

Try:

[code]
ele = driver.find_element_by_id(‘selectEle’)
for option in ele.find_elements_by_tag_name(‘option’):
if option.text == ‘your text’:
option.click()
break