【发布时间】:2015-10-28 15:11:47
【问题描述】:
我正在学习如何使用 Behat/Mink 和 Selenium 编写验收测试,我需要验证特定表格单元格的值。我发现我必须使用 xpath 来执行此操作,但我无法弄清楚确切的语法。表格如下:
html:
<table class="admintable generaltable" id="relationships">
<thead>
...
</tr>
</thead>
<tbody><tr class="r0 lastrow">
<td class="leftalign cell c0" style="">Cohort 1</td>
<td class="leftalign cell c1" style="">0</td>
<td class="leftalign cell c2" style="">Non-editing teacher</td>
<td class="centeralign cell c3" style="">No</td>
<td class="leftalign cell c4" style="">No</td>
<td class="leftalign cell c5 lastcol" style=""><a href="http://150.162.242.121/mariana/unasus-cp/local/relationship/edit_cohort.php?relationshipcohortid=1&delete=1"><img src="http://150.162.242.121/mariana/unasus-cp/theme/image.php/standard/core/1445875205/t/delete" alt="Delete" title="Delete" class="iconsmall" /></a> <a href="http://150.162.242.121/mariana/unasus-cp/local/relationship/edit_cohort.php?relationshipcohortid=1"><img src="http://150.162.242.121/mariana/unasus-cp/theme/image.php/standard/core/1445875205/t/edit" alt="Edit" title="Edit" class="iconsmall" /></a></td>
</tr>
</tbody>
</table>
我要写的语句是:
Then I should see "No" in the "???" "css_element"
我应该如何写该语句以指定我想要第一个“否”,在“Inscrição em vários grupos”下,在“否”部分。
编辑:我最初犯了一个错误,我应该使用“xpath_element”作为选择器,而不是“css_element”
【问题讨论】:
标签: selenium xpath behat acceptance-testing gherkin