硒網絡驅動程序代碼,我想這一個:
driver.findElement(By.xpath(".//a[contains(.,'terw')]")).findElement(By.xpath(".//img[@id='delete_fully_img'])")).click();
,但其沒有工作,我的代碼:
<table id="Table_1" class="dataTable" aria-describedby="Table_1_info" style="width: 100px;">
<thead>
<tr class="header" role="row">
<td class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 213px;">Point Name</td>
<td class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 149px;">Description</td>
<td class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 150px;">Date Added</td>
<td class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 46px;"/>
</tr>
</thead>
<tbody role="alert" aria-live="polite" aria-relevant="all">
<tr class="odd">
<td class=" ">
<a id="attachment_title_382" slider_number="0" onclick="AddPoints('edit', '382', '');" href="javascript:void(0);">terw</a>
</td>
<td class=" "/>
<td class=" ">02/21/2017</td>
<td class=" ">
<img id="delete_fully_img" onclick="deletePoint('', '382', '382', '0');" title="Delete Point" style="height:17px;width:17px;" src="http //close_icon.png"/>
</td>
</tr>
<tr class="even">
<td class=" ">
<a id="attachment_title_301" slider_number="0" onclick="AddPoints('edit', '301', '1');" href="javascript:void(0);">1</a>
</td>
<td class=" "/>
<td class=" ">02/15/2017</td>
<td class=" ">
<img id="delete_fully_img_1" onclick="deletePoint('', '301', '301', '0');" title="Delete Point" style="height:17px;width:17px;" src="http //close_icon.png"/"/>
</td>
</tr>
</tbody>
問題不明確,請添加其他細節或刪除的問題,如果它已經被問錯。 – user3251882
錯誤?這是否真的發生?我只是想知道是否有人過來這個網站,並且「哎呀,我只是把這一切都錯了。」 – RSon1234
閱讀文章。 http://stackoverflow.com/help/how-to-ask –