在我的应用程序中有几行,并在每行最后一列中有'编辑'|'删除'的选项,当点击编辑,在同一个地方,我们得到选项“更新” |“取消”,我成功地点击编辑,做了一些改变,当我尝试点击更新它抛出一个错误:量角器 - 多个找到的定位器元素by.css(.....)
more than one element found with locator
by.css(..)
as both have same code
<td>
<div class="biometricActionCln ng-hide" ng-show="!list.isEditable" style="">
<a ng-click="editBiometrics(list, $index)">
**<i class="fa fa-pencil-square-o">**
</i> Edit</a>
<span> | </span>
<div ng-show="list.isEditable" class="" style="">
<a ng-click="manageEditBiometric(editBiometric, 'Modify', list.biometricId)">
**<i class="fa fa-pencil-square-o">**
</i> Update</a>
<span> | </span>
</div>
</td>
请让我知道如何点击更新链接。
谢谢你,但我需要通过名称(第一列)确定行,单击编辑在字段中做一些更改,然后单击更新。点击编辑我已经使用 'element.all(by.repeater(“list in biometricsList”))。filter(function(_tableRow){__ __ __ __ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ g。}(by.css(“td:nth-child 1)“))。getText()。then(function(name){ return name ==”name1“; }) })。first()。element(by.css(”i.fa-pencil- “ 我需要单击此特定行的更新链接 –
如果您正在进行内联编辑,最有可能的”更新“按钮仅在您正在编辑的当前行中可见。你为什么不尝试使用linkText选择器。元素(by.linkText('Update'))或元素(by.partialLinkTex('Update')) – BKS