ggiunta
ggiunta

Reputation: 143

Selenium WebDriver: select value from KendoUI DropDownList

I'm not being able to select a value from a Kendo's dropdown, this is the code (C#):

var wannabeSelect = FindElement(By.Id("Type"));
wannabeSelect.SelectByValue("HouseHold");

That's not the selenium raw api, I'm wrapping it up. In this case, FindElement() returns a SelectElement, but when I try to select a value nothing happens on my target web-app (I don't get any code exception, the test succeeds). I believe that Selenium does not support this Kendo UI control, is there a recommended way to handle not supported UI elements like this one?

Upvotes: 2

Views: 8570

Answers (1)

ggiunta
ggiunta

Reputation: 143

We made it using Selenium's JS excecutor:

ScriptExecutor.Execute(string.Format("$('#{0}').data('kendoDropDownList').value('{1}')", "Type", value));

Upvotes: 5

Related Questions