硒网络驱动程序代码,我想这一个:
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 –