On my webpage I have two buttons, how to identify which one is which?
<button onclick="addToSelected('newApplicationForm');">Add Strategy</button>
<button onclick="submitAddNewApplication('newApplicationForm');">Submit</button>
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.
You say it’s your webpage. Any chance you could put IDs to your elements? Would make it easier to identify them uniquely. If not, solution below.
You could use this XPath expression:
Which will identify it by the javascript call, or you could try:
Which will match the content.
For the submit-button, you could try the same principle with identifying by javascript:
or by content:
Note: Some languages seem to use text() instead of the dot
.to refer to the actual text in an element.