Im currently testing using PHPUnit and i need to create and delete the same things. So i create something called test, i want to be able to find it and delete it. I have multiple Delete buttons on the page, and it works by doing something like this -
$this->click("xpath=(//img[@title='Delete'])[11]");
but by choosing [11] for example, it is only using the delete button from row 11. And if Test isnt Row 11 for example, i will delete something i do not wish to delete.
I wish to try and delete a specific row by finding a row with a certain id attached to it.
The row may have the words "Test" followed by more information within columns. Then a delete button at the end titled 'Delete'. I wish to find the row with the id or words 'Test' and then find and use the 'Delete' title on that row.
Any help?
EDIT -Example image of a row. I would like to grab the first text, and then use the very last button on the right titled 'Delete'
http://i.stack.imgur.com/S4BNE.png
SECOND EDIT - This is the whole table, it contains all of the rows and within the rows it contains the td's (Obviously, as you'd know). This is where ill find the text im trying to find. This tr would count as the 4th of 6.
This shows the td containing delete, a td containing 'Test Profile' and the whole table itself. http://i.imgur.com/4r1tsJe.png
TL;DR Essentially, im trying to do, Where td contains 'Test', use 'Delete' from the same row.