I have list of elements:
<li ng-repeat="list in lists track by $index">
<a href="" ng-click="doSomething($index)">{{list.name}}</a>
<button class="destroy" ng-click="remove(list)"></button>
</li>
I am trying to click the last button.
it('test', function () {
var row = element.all(by.repeater('list in lists track by $index')).last();
row.findElement(by.tagName('button')).click();
});
but I get
Message: Failed: row.findElement is not a function
I have list of elements:
<li ng-repeat="list in lists track by $index">
<a href="" ng-click="doSomething($index)">{{list.name}}</a>
<button class="destroy" ng-click="remove(list)"></button>
</li>
I am trying to click the last button.
it('test', function () {
var row = element.all(by.repeater('list in lists track by $index')).last();
row.findElement(by.tagName('button')).click();
});
but I get
Share Improve this question edited Mar 20, 2016 at 13:36 Michal asked Mar 20, 2016 at 13:30 MichalMichal 1932 gold badges3 silver badges14 bronze badges 2Message: Failed: row.findElement is not a function
- What is row.findElement, jasmine or karma function? Or protractor? – z.a. Commented Mar 20, 2016 at 13:41
- Protractor link – Michal Commented Mar 20, 2016 at 13:44
1 Answer
Reset to default 12Use element()
instead:
row.element(by.tagName('button')).click();