1
votes

I know kendo-ui hides elements from view. unselectable="on" However, I am unable to find a specific drop down or it's options using capybara.

Please see image here.

I've tried adding the :visible => false tag to a find, but that does not seem to help, either. (or it does, and I'm using the wrong selector.)

I just want to the be able to select one of the options in the drop down.

EDIT: "You don't show the actual HTML from the elements that actually become visible on the page," ~Thomas Walpole

Here it is!

1
Show the code you've triedThomas Walpole
Some of what I've tried: #find('#systemType > option:nth-child(2)').select_option #Select "bar system" #find('#systemType', :visible => false, :text=>'Bar System', :match=>:prefer_exact).click #find('span.k-widget.k-dropdown.k-header.input').click #find('[id=systemType]', :visible => false).click #select("Bar System", from: '[id=systemType]', :visible => false).select_option #find("input[value='bar']", :visible => false).click within( all('[id^="qq5_"]')[0] ) do find('span.k-widget.k-dropdown.k-header.input', :visible => false).sibling('span').click endSarah Edwards Kladstrup
Using the visible: false option only makes sense as a step towards locating other elements that are actually visible (see my answer). This is because a user can't (and therefore neither should you in tests) interact with non-visible elements, so click on a non-visible element is meaningless. Additionally the actual visible elements on your page are not <select> or <option> elements so select and select_option don't make sense either.Thomas Walpole

1 Answers

0
votes

You don't show the actual HTML from the elements that actually become visible on the page, it'll be much further down the HTML and probably with an id of 'systemType_listbox(based on thearia-owns` attribute on the wrapping span. But, something like

find('select#systemType', visible: :hidden).sibling('span').click # trigger the opening of the dropdown widget
find('#systemType-list li', text: 'Bumper').click # select the Bumper option from the now visible list

will probably do want you want.