admin管理员组文章数量:1406008
In my application there are couple of rows and in each row last column, there is option of 'Edit'|'Delete' and when click on Edit, on the same place we get option for 'Update'|'Cancel', I successfully clicked on edit, made some changes and when I try to click on update it throws an error:
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>
Kindly let me know how do I click on update link.
In my application there are couple of rows and in each row last column, there is option of 'Edit'|'Delete' and when click on Edit, on the same place we get option for 'Update'|'Cancel', I successfully clicked on edit, made some changes and when I try to click on update it throws an error:
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>
Kindly let me know how do I click on update link.
Share Improve this question edited May 24, 2017 at 12:15 alecxe 475k127 gold badges1.1k silver badges1.2k bronze badges asked May 24, 2017 at 6:24 Hema LathaHema Latha 851 gold badge3 silver badges12 bronze badges1 Answer
Reset to default 5Below are different ways of handling multiple elements.
accessing multiple elements with index:
element.all(by.css('.selector'))[0]
element.all(by.css('.selector'))[1]
accessing multiple elements by calling methods:
element.all(locator).first();
element.all(locator).last();
accessing multiple elements through callback function:
element.all(by.css('.selector')).then(function(elements) {
// elements is an array of ElementFinders.
});
本文标签: javascriptProtractormore than one element found for locator bycss()Stack Overflow
版权声明:本文标题:javascript - Protractor - more than one element found for locator by.css(.....) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744969739a2635163.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论