Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Protractor: 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

Message: Failed: row.findElement is not a function

like image 265
Michal Avatar asked Mar 20 '16 13:03

Michal


1 Answers

Use element() instead:

row.element(by.tagName('button')).click();
like image 98
alecxe Avatar answered Sep 19 '22 22:09

alecxe