2015-12-02 96 views
0

我是新手Selenium IDE用户。我试图“点击”ID为动态的表中的项目;当从表格添加或删除新项目时,它会发生变化。具体项目在[td id =“GroupsNotAssigned_LBI2T0”]下面的HTML代码末尾标识。与id关联的项目文本是[NPM读写数据和只读保留]。硒IDE:包含动态ID的表项

在此先感谢您的帮助 使用Selenium IDE 2.9 使用Firefox 42.0

<td id="frmProfile_4_2" class="dxflGroupCell"> 
<table class="dxflCLTSys dxflItemSys dxflCustomItemSys dxflItem" cellspacing="0" cellpadding="0" style="border-collapse:collapse;border-collapse:separate;"> 
<tbody> 
<tr> 
<td class="dxflHALSys dxflVATSys dxflCaptionCell dxflCaptionCellSys" style="width: 98px;"> 
<label class="dxflCaption">Not a member of:</label> 
</td> 
</tr> 
<tr> 
<td class="dxflNestedControlCellSys dxflNestedControlCell"> 
<input id="GroupsNotAssignedDeletedItems" type="hidden" value="" name="GroupsNotAssignedDeletedItems"> 
<input id="GroupsNotAssignedInsertedItems" type="hidden" value="" name="GroupsNotAssignedInsertedItems"> 
<input id="GroupsNotAssignedCustomCallback" type="hidden" value="" name="GroupsNotAssignedCustomCallback"> 
<table id="GroupsNotAssigned" class="dxeListBox_BFS2014 " cellspacing="0" cellpadding="0" style="height:250px;width:250px;border-collapse:collapse;border-collapse:separate;"> 
<tbody> 
<tr> 
<td> 
<div id="GroupsNotAssigned_D" class="dxlbd" style="height: 246px; width: 248px; overflow: auto;" tabindex="-1"> 
<input id="GroupsNotAssigned_VI" type="hidden" name="GroupsNotAssigned" value="113"> 
<table cellspacing="0" cellpadding="0" style="border-collapse:collapse;border-collapse:separate;visibility:hidden!important;display:none!important;"> 
<tbody> 
<tr id="GroupsNotAssigned_LBI-1" class="dxeListBoxItemRow_BFS2014"> 
<td id="GroupsNotAssigned_LBI-1T0" class="dxeListBoxItem_BFS2014"> </td> 
</tr> 
</tbody> 
</table> 
<table id="GroupsNotAssigned_LBT" cellspacing="0" cellpadding="0" style="width: 100%; border-collapse: separate;"> 
<tbody> 
<tr class="dxeListBoxItemRow_BFS2014"> 
<tr class="dxeListBoxItemRow_BFS2014"> 
<tr class="dxeListBoxItemRow_BFS2014"> 
<td id="GroupsNotAssigned_LBI2T0" class="dxeListBoxItem_BFS2014">NPM Read Write Data and Read Only Reserves</td> 
</tr> 

[代码图像1]

enter image description here

回答

0

不知道你想做什么,但它看起来像这应该工作:

<tr> 
    <td>click</td> 
    <td>//td[contains(@id,"GroupsNotAssigned_LBI"]</td> 
    <td></td> 
</tr> 
+0

谢谢...我的问题是LBI中的“2”...字符串是动态的...有时它是2和其他时间它可能是一些其他整数...我一直在试图弄清楚以达到“NPM读写数据和只读储备”的标题,但我似乎无法找到正确的目标。 –

+0

我编辑我的答案,我认为你要求动态:我们只检查GroupsNotAssigned_LBI,所以2TO可以是任何东西。 – DMart

+0

我感谢你的帮助。我的问题是“GroupsNotAssigned_LBI”标签包含项目列表;每个项目由一个整数指定,但整数随着用户与项目列表的交互而改变。测试包括从列表中选择一个项目并将其移至应用程序中的另一个表格。再次感谢。 @DMart –