I have a drop down menu. I want capybara to go through it and find the specific element and click on it. I'm currently trying to do a within clause and having it iterate through the list and find this element: "Cow_poop"
<li role="option" unselectable="on" title="Cow_poop" class="ant-select-dropdown-menu-item ant-select-dropdown-menu-item-selected" aria-selected="true" style="user-select: none;">Cow_pop</li>
This is the code that I'm trying to do.
find('div.ant-select-dropdown-menu-item-selected', text: 'Cow_poop').click
However it's giving me this error:
Capybara::ElementNotFound:
Unable to find css "div.ant-select-dropdown-menu-item-selected"