Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何将元素验证为特定的span ID元素_Html_Xpath_Selenium Ide_Elements - Fatal编程技术网

Html 如何将元素验证为特定的span ID元素

Html 如何将元素验证为特定的span ID元素,html,xpath,selenium-ide,elements,Html,Xpath,Selenium Ide,Elements,我使用的是Selenium IDE,需要找到一个正确的verifyElementPresent来表示特定ID元素。例如,我现在需要将类“icogreen icon fioyes”与id“toy_rule2_checkmark”关联起来。看看下面的html代码 只有一个类别“icogreen icon fioyes”(表示标签上有绿色复选标记)。这将在网站上更改为 “玩具规则1”复选标记“ “玩具规则2”复选标记“ “玩具规则3\u复选标记” 现在我在下面有这个,但它只针对绿色复选标记,而不是特定

我使用的是Selenium IDE,需要找到一个正确的verifyElementPresent来表示特定ID元素。例如,我现在需要将类“icogreen icon fioyes”与id“toy_rule2_checkmark”关联起来。看看下面的html代码

只有一个类别“icogreen icon fioyes”(表示标签上有绿色复选标记)。这将在网站上更改为

“玩具规则1”复选标记“
“玩具规则2”复选标记“
“玩具规则3\u复选标记”

现在我在下面有这个,但它只针对绿色复选标记,而不是特定的ID

命令:
验证元素存在

目标:
//span[包含(@class,'icogreen图标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>

玩具销售额的8%高达49.99美元
玩具销售额的10%$50.00-$149.99
12%的玩具销售额为150.00美元及以上

确切的问题是什么?是否要匹配所有三个
toy\u ruleX\u checkmark
元素?确切问题=我确实要匹配所有三个toy\u ruleX\u checkmark元素,但不能同时匹配。我喜欢逐个匹配每个元素,这样每个元素都有class=“icogreen icon fioyes”