【发布时间】:2011-08-09 07:27:58
【问题描述】:
我正在尝试为表中的各种列链接创建 selenium xpath。每一行都是唯一标识的。在每一行中,我知道一列的名称(产品名称)并根据产品名称尝试在表中查找其他链接以对该产品执行其他操作,例如更改开始日期和结束日期以及删除产品等。
有人可以阐明为表格中的每一列创建 xpath。表名如下:
tooltip nameofprodduct percentage startdate enddate checkbox1 checkbox2 remove
<tr id="225259">
<td><a class="tooltip "><img alt="info" src="media/tooltip.gif" class="tooltip"><div style="display: none;"></a></td>
<td>name(299106)</td>
<td><div class="increse"><div style="display: none;" class="slidermetrics"></div><span onclick="showBoostSlider(225259,0,0,0,0);" class="increse">0%</span></td>
<td nowrap="nowrap" class="start"><span class="nonEdit"><span class="pointer">none</span><a href="#" class="ui-corner-all ui-button-small"><span class="icon-date"></span></a></span><span style="display: none;" class="edit"><input type="text" value="" style="width: 80px; margin-right: 7px;" class="inlineCalendarDisplay"><input type="hidden" value="" class="inlineCalendar"><a href="#" class="close"><span class="icon-cancel"></span></a><a href="#" class="save"><span class="icon-disk"></span></a></span><span class="tablesorterHiddenSortData"></span></td>
<td nowrap="nowrap" class="end"><span class="nonEdit"><span class="pointer">none</span><a href="#" class="ui-corner-all ui-button-small"><span class="icon-date"></span></a></span><span style="display: none;" class="edit"><input type="text" value="" style="width: 80px; margin-right: 7px;" class="inlineCalendarDisplay"><input type="hidden" value="" class="inlineCalendar"><a href="#" class="close"><span class="icon-cancel"></span></a><a href="#" class="save"><span class="icon-disk"></span></a></span><span class="tablesorterHiddenSortData"></span></td>
<td><input type="checkbox" onchange="switchEnabled('PEnabled',this,'225259');" checked="checked"></td>
<td><input type="checkbox" onchange="switchEnabled('SEnabled',this,'225259');" checked="checked"></td>
<td><a onclick="$('#tab3 > table.jsonTable').rGrid('remove',225259); return false;" href="#">remove</a></td>
</tr>
【问题讨论】: