Issue
I have three <div class= emploBox "> and each has a button. Buttons do not have unique names. How can I find this particular button? I want to use class=cutTooLongTest and test 'automated tester' but I don't know how. wants to find the button marked in yellow.
href="https://i.stack.imgur.com/hDktc.png" rel="nofollow noreferrer">enter image description here
I have no idea for a solution
Solution
If I understood you right, you need to find the XPath for the button using the text 'automated tester'.
The XPath expression should be like this:
//h2[text() = 'automated tester']//..//button[contains(@class, 'standard Button--icon')]
Answered By - Norayr Sargsyan
Answer Checked By - David Goodson (JavaFixing Volunteer)