Michal
Michal

Reputation: 193

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

Upvotes: 5

Views: 2349

Answers (1)

alecxe
alecxe

Reputation: 473833

Use element() instead:

row.element(by.tagName('button')).click();

Upvotes: 12

Related Questions