I try to pick a value from a dropdown using selenium webdriver, but I get only errors.
I just want to select Ubuntu 16.04 from the OS Dropdown.
I tried to click at the dropdown and then on the Ubuntu 16.04 element (There are 3 in the source code). I tried the wait.until
method, but nothing succeed.
from selenium.webdriver.support.select import Select
from selenium import webdriver
url = 'https://clients.hostwinds.com/buycloud/289'
driver = webdriver.Firefox()
driver.get(url)
firstname = driver.find_element_by_name("firstname").send_keys('First')
lastname = driver.find_element_by_name("lastname").send_keys('Last')
email = driver.find_element_by_name("email").send_keys('mail@example.com')
password = driver.find_element_by_name("password").send_keys('123456789')
submit = driver.find_element_by_css_selector("#signup > div:nth-child(1) > div:nth-child(2) > form:nth-child(1) > div:nth-child(4) > div:nth-child(1) > div:nth-child(1) > input:nth-child(1)").click()
## next page
state = Select(driver.find_element_by_name("state")).select_by_index(2) ## works fine
## Here the problem begins: I need to choose Ubuntu 16.04 but all of my attemts failed
os = driver.find_element_by_xpath('//*[@id="inputConfigOption337"]')
os.location_once_scrolled_into_view
Select(os).select_by_index(5)
I get the following error:
selenium.common.exceptions.ElementNotInteractableException: Message: Element could not be scrolled into view