Yes, if you use something like my case in haml:
%div{id: "23", class: 'operations'} %a.delete{ href: '#', class: 'smallbtn'} %img{ src: 'assets/delete.png', alt: 'Delete'} %a.edit{ href: "#", class: 'smallbtn'} %img{ src: 'assets/edit.png', alt: 'Editar Producto'}
and you donβt want to use the identifier to click the link, and you use images, for example, in my case, to click the delete link that you must declare to the class, and then you can use the following code to click the element and additionally to confirm the modal operation :
within '#23' do find('.delete').click page.driver.browser.switch_to.alert.accept end
heriberto perez
source share