There is a table of the form
1 | Fod | foo@bar.com | edit | delete
2 | Bad | bar@foo.com | edit | delete
edit and delete are buttons. It is necessary to test for the appearance of an alert message when deleting Bad.
all('.button').last.click does not launch an alert message. However, if you redirect it to edit
all('.button')[-2].click That edit page is displayed without problems.