简体   繁体   English

Selenium IDE-如何在Rails应用程序中定位删除链接

[英]Selenium IDE - how to target delete links in Rails applications

What's a good way to target delete links in rails applications? 在Rails应用程序中定位删除链接的好方法是什么?

For example this link 例如此链接

<a href="/auto_policies/autos/10693.mobile" class="remove-auto"
 data-confirm="Are you sure?" data-icon="delete" data-method="delete" 
 data-remote="true"></a>

If possible, target the ID (or add one and target it). 如果可能,定位ID(或添加一个并定位它)。
If this is not possible, for example you don't have access to check the rails code then use the following method: 如果这是不可能的,例如,您无权检查rails代码,请使用以下方法:

Target the element with the class .remove-auto to scope it down to just selecting "remove auto" links. 使用.remove-auto类定位该元素,以将其范围缩小到仅选择“自动删除”链接。
Then make sure it is a delete link with [data-method=delete] . 然后确保它是带有[data-method=delete]的删除链接。

Thus you end up targeting the delete link with 因此,您最终将删除链接定位为

a.remove-auto[data-method=delete]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM