I'm trying to select and click in an invisible dropdown menu using selenium webdriver.
HTML:
<div id = "ID_1" class="mb-outer-container" style="display: none;">
.....
<select style="font-size:10px", onchange="dg_send('contractNonParticipationsDatagrid2080-form');>
<option selected="selected" value="10">10</option>
<option selected="selected" value="20">20</option>
<option selected="selected" value="30">30</option>
What I've been trying to do:
sel = Select(browser.find_element_by_xpath("//select[@style='font-size:10px']"))
sel.select_by_visible_text("20")
also tried to select by value:
sel.select_by_value("20")
Both lead to the same error: ElementNotInteractableException: Message: element not interactable: Element is not currently visible and may not be manipulated
It seems like I'm able to find the elemtent, but unable to select the and click the option in the dropdown
You first need to display the dropdown to select the option.
This will click on the dropdown and show the options of the dropdown. Then you can click on the option.
Also need to import this
The driver.find_element_by_xpath() is deprecated in newest version.