![](/img/trans.png)
[英]How to safely generate account activation links in Rails / cloud 9 ide
[英]Selenium IDE - how to target delete links in Rails applications
在Rails應用程序中定位刪除鏈接的好方法是什么?
例如此鏈接
<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>
如果可能,定位ID(或添加一個並定位它)。
如果這是不可能的,例如,您無權檢查rails代碼,請使用以下方法:
使用.remove-auto
類定位該元素,以將其范圍縮小到僅選擇“自動刪除”鏈接。
然后確保它是帶有[data-method=delete]
的刪除鏈接。
因此,您最終將刪除鏈接定位為
a.remove-auto[data-method=delete]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.