I'm using selenium in python and I'm looking to select the option Male from the below:
<div class="formelementcontent">
<select aria-disabled="false" class="Width150" id="ctl00_Gender" name="ctl00$Gender" onchange="javascript: return doSearch();" style="display: none;">
<option selected="selected" title="" value="">
</option>
<option title="Male" value="MALE">
Male
</option>
<option title="Female" value="FEM">
Female
</option>
</select>
Before selecting from the dropdown, I need to switch to iframe
driver.switch_to.frame(iframe)
I've tried many options and searched extensively. This gets me most of the way.
driver.find_element_by_id("ctl00_Gender-button").click()
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.ID, "ctl00_Gender")))
select=Select(driver.find_element_by_id("ctl00_Gender"))
check=select.select_by_visible_text('Male')
If I use WebDriverWait it times out.
I've tried selecting by visible text and index, both give:
ElementNotInteractableException: Element could not be scrolled into view