I am trying to use capybara (ruby bindings) to select an item from a dropdown that does not have an id or unique class, but I seem to be unable to do so.
The select box in question looks like this:
<select data-bind="options: environments, optionsText: 'name', value: selectedEnvironment, optionsCaption: 'Choose...'" class="form-control">
Trying to do a:
select("option",:from "#panel > div.panel-body > form > div:nth-child(1) > select")
does not work, but I am able to find the select field using a
page.find("#panel > div.panel-body > form > div:nth-child(1) > select")
The documentation says that the select method expects an id, name or label of the select box, but surely there must be a way of selecting something from a dropdown that is more specific than this. Is there another method I can use other than select() or do I have to go back to using pure selenium?