Answer the question
In order to leave comments, you need to log in
Why does Capybara not see the checkbox?
Here is a snippet from the form:
<div class='cr-cat'>
<ul>
<li>
<input disabled='disabled' id='cat-17' name='cat' type='checkbox' value='cat17'>
<label for='cat-17' onclick="$('.podcat#17').slideToggle('fast');">Программирование</label>
<ul class='podcat' id='17' style='display: none;'>
<li>
<input id="task_subcategories_12" name="task[subcategories][]" type="checkbox" value="12" />
<label for='task_subcategories_12'>Python</label>
</li>
</ul>
</li>
</ul>
</div>
<label for='cat-17'>
..., subcategories are expanded, which, in fact, you need to select. check 'Python'
check '#task_subcategories_12'
find(:xpath, "//input[@value='task_subcategories_#{@subcategory.id}']").set(true)
find(:xpath, "//input[@value='cat#{@category.id}']").set(true)
find(:xpath, "//input[@value='#{@subcategory.id}']").set(true)
Unable to find xpath "//input[@value=''12"]" ...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question