I was testing my code over: https://semantic-ui.com/modules/dropdown.html
I wrote the following code in Python3 which finds all drop-downs in a given webpage and selects the last option for each drop-down:
dropdowns = driver.find_elements(By.XPATH, '//select[@class="ui dropdown"]')
print(str(len(form_dropdowns)))
for drop_down in form_dropdowns:
driver.execute_script("arguments[0].click();", drop_down)
options = drop_down.find_elements(by=By.TAG_NAME, value='option')
print(str(len(options)))
driver.execute_script("arguments[0].click();", options[len(options) - 1])
time.sleep(100)
I see the following printed on screen:
2
3
3
Which means 2 drop-downs were found, both with 3 options to select from.
BUT I don't see any value being changed in the UI, why is that?