TestProject Forum
Powered by leading experts in the test automation community

Selecting <option> with Selenium in python

How can I select child of a using selenium in python ?

WebElement.select() is not yielding results for some reason.

What am I doing wrong ?

You can use selenium.webdriver.support.ui.Select

[code]from selenium import webdriver
from selenium.webdriver.support.ui import Select

driver = webdriver.Firefox()

select = Select(driver.find_element_by_id(id))
print select.options
print [o.text for o in select.options]
select.select_by_visible_text()[/code]