jeudi 25 juin 2015

Click a button with XPath using an id from the same row

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?

Aucun commentaire:

Enregistrer un commentaire