I am using capybara to click a checkbox, however it can\'t seem to find it no matter what I do. I am able to correctly find both the span and the label inside the span, but
Try to add :visible
option set to false.
find('#agreement', visible: false).click
By default Capybara finds only visible elements. It seems that underlying driver identified this input as invisible so it hasn't been found by Capybara.
:visible
option is also supported by most of other Capybara methods (like check
, has_css?
, have_selector
, etc.)