For some reason when I do this:
click_on("Save")
My Capybara detects both:
<button>Save</button>
<button>Save & Schedule</button>
And so it gives “ambiguous match: 2 elements found” error.
Is there a way to tell it to do exact match?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, there is no way to do that. You have to add uniq ids for these buttons since capybara 2.0 rises an error if more than one element was found.