我有一個表中有兩行,每個都有一個'預覽'按鈕,我想用水豚測試,但我很努力想出如何單擊每個預覽按鈕。我是新來的水豚,所以我還在學習。這是表看起來像什麼點擊鏈接基於ID與水豚
<tr>
<td>
<a data-target="#1_edit_prompt" data-toggle="modal" href="#">Cta 1</a>
</td>
<td class="nowrap">
Cta 1
</td>
<td class="nowrap">
<a data-target="#1_uses_modal" data-toggle="modal" href="#">0</a>
</td>
<td class="nowrap">
3/9/2017
</td>
<td class="actions">
<a data-target="#1_edit_prompt" data-toggle="modal" href="#">Edit</a>
<a data-target="#1_delete_modal" data-toggle="modal" href="#">Delete</a>
<a class="cta-preview" data-cta_id="1" href="#">Preview</a>
</td>
</tr>
<tr>
<td>
<a data-target="#2_edit_prompt" data-toggle="modal" href="#">Cta 2</a>
</td>
<td class="nowrap">
Cta 2
</td>
<td class="nowrap">
<a data-target="#2_uses_modal" data-toggle="modal" href="#">0</a>
</td>
<td class="nowrap">
3/9/2017
</td>
<td class="actions">
<a data-target="#2_edit_prompt" data-toggle="modal" href="#">Edit</a>
<a data-target="#2_delete_modal" data-toggle="modal" href="#">Delete</a>
<a class="cta-preview" data-cta_id="2" href="#">Preview</a>
</td>
</tr>
你可以看到每個預覽按鈕都有data-cta_id,每個按鈕都是唯一的。我想單擊一個基於該ID的按鈕