Just a note, before flagging as duplicate, I have reviewed many answers and haven't found one that works.
I have a KendoUI dropdown showing a list of states:
I can successfully automate the dropdown with Selenium's Click()
event:
var stateField = driver.FindElementById("stateField");
stateField.Click();
I am unable to select an actual state here. After the dropdown expands, I have attempted to use SendKeys() to send it down arrows / enter to select an option, but I get:
WebDriverException: unknown error: cannot focus element
What is the correct approach? Do I have to use Selenium's JavaScript capabilities here? I noticed the individual options are not given an ID or a name, so I can't select them via that method:
Here is the dropdown as seen in the inspector: