I'm trying to get a simple input submit to click using capybara
. The submit button
is actually on a modal. However, trying a few capybara
still not working. Since I'm doing testing, I'm advise to not modify the code base. Adding an id
would solve this easily but I have to do without it.
HTML code
<input type="submit" class="btn btn-primary text-uppercase" value="Create" form="new_tab">
Capybara commands tried
find("input[type=submit][value='Create']").click
find('input[type]="submit"]').click
find('input[class="btn btn-primary text-uppercase"]').click
Try to use this version:
find('input[name="commit"]').click
It helps me all time.
click_button("Create")
should click it, assuming it is visible on the page. http://www.rubydoc.info/gems/capybara/Capybara%2FNode%2FActions%3Aclick_button
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