Answer the question
In order to leave comments, you need to log in
Why does Capybara not see the option on the page?
When trying to use the select method, Capybara throws the following error:
Unable to find option "Back-End" (Capybara::ElementNotFound)
select 'Back-End', :from => 'product_category_id'
<%= f.select :category_id, Category.all.collect { |c| [ c.name, c.id ] } %>
<select name="product[category_id]" id="product_category_id">
<option value="1">Back-End</option>
<option value="2">Front-End</option>
</select>
Answer the question
In order to leave comments, you need to log in
Maybe because it is not there in the test environment? try `save_and_open_page` and make sure the desired option exists.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question