Given the HTML below how can I find the delete link?
I’ve been able to select the row with:
//td[contains(text(),'DeleteMe')]/../../tr
but I can’t seem to find a way to select the delete button.
For example I tried:
//td[contains(text(),'DeleteMe')]/../../tr//a[@class='delete_link'] but it did not select the link.
I can’t use the ID’s 403, 113, 112, etc and I need a script without actual ID’s for re-testing purposes.
<tr class="odd" id="activity_403">
<td class="name">DeleteMe</td>
<td class="direct">false</td>
<td class="">
<ul>
<li><a href="/admin/roles/113/edit">Language Therapist</a></li>
<li><a href="/admin/roles/112/edit">Speech Therapist</a></li>
</ul>
</td>
<td class="">
<a href="/admin/activities/403" class="member_link view_link">View</a>
<a href="/admin/activities/403/edit" class="member_link edit_link">Edit</a>
<a href="/admin/activities/403" class="member_link delete_link" data-confirm="Are you sure you want to delete this?" data-method="delete" rel="nofollow">Delete</a>
</td>
</tr>
Found it: