Please help me solve this problem with capybara
I have a button like this in capybara:
<input type="submit" value="Verify" name="verify" id="verify" class="button">
I tried with
click_button "verify"
but it gives error:
Failure/Error: find('#verify').click
NoMethodError:
undefined method `node_name' for nil:NilClass
The problem lies inside the html code:
<div>
<form>
<div>
</div>
</div>
<input type="submit" value="Verify" name="verify" id="verify" class="button">
</form>
Because there is one redundant </div>
, the <input>
was treat outside the form, hence capybara
cause those error. After delete the redundant </div>
, everything works fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With