我使用的是Selenium IDE,需要为特定的ID元素找到正确的verifyElementPresent。例如,我需要关联课程" icogreen icon-fioyes"到了id" toy_rule2_checkmark"截至目前。看下面的HTML代码
只有一个班级" icogreen icon-fioyes" (这表示标签的绿色复选标记)。这将在网站上更改为
" toy_rule1_checkmark"
" toy_rule2_checkmark"
" toy_rule3_checkmark"
现在我刚才有这个,但这只针对绿色复选标记而不是特定ID
命令:
verifyelementPresent
目标:
// span [包含(@class,' icogreen icon-nwxyes')]
提前谢谢
<div class="benefits">
<div id="toy_rule1" class="row even">
<span id="toy_rule1_checkmark" class="fiono"></span>
8% of toys sales up to $49.99
</div>
<div id="toy _rule2" class="row odd">
<span id="toy_rule2_checkmark" class="icogreen icon-fioyes" style="background-color: transparent;"></span>
10% of toys sales $50.00-$149.99
</div>
<div id="toy_rule3" class="row even">
<span id="toy_rule3_checkmark" class="fiono"></span>
12% of toys with sales $150.00 and above
</div>
</div>