1

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:

The rendered states dropdown

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:

The individual state items in the dropdown

Here is the dropdown as seen in the inspector:

Inspector DOM view

Patrick
  • 5,526
  • 14
  • 64
  • 101

0 Answers0