Unable to select the kendo dropdown using below code. The site can be reachable for checking the code.
<span unselectable="on" class="k-dropdown-wrap k-state-default"><span unselectable="on" class="k-input">Chang</span><span unselectable="on" class="k-select" aria-label="select"><span class="k-icon k-i-arrow-60-down"></span></span></span>
Code:
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.select import Select
from selenium.webdriver.common.keys import Keys
import time
driver = webdriver.Chrome('./chromedriver')
driver.get("https://demos.telerik.com/kendo-ui/dropdownlist/remotedatasource")
select = driver.find_element_by_xpath('//*[@id="example"]/div/span/span/span[1]')[0]
select.SelectByValue("Chang");
print('Success')
To select the item with text as Chang within the kendo dropdown using Selenium you you have to induce WebDriverWait for the
element_to_be_clickable()
and you can use either of the following Locator Strategies:Using
CSS_SELECTOR
:Using
XPATH
:Note : You have to add the following imports :
Browser Snapshot: