Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular JS How to get all rows of a repeater with Protractor?

I have a table with all users and I want to search for a user with the column {{user.name}} === 'X'. When I found the right row I want to delete the entry with a click on the last column of the row.

element(by.repeater('user in allUsers')).then(function(rows) {
  for (var i = 0; i < rows.length; ++i) {
    // if the right row is found click on the last column to delete it
  } 
});

I get an TypeError: Object # has no method 'then'

I found my solution here but that is still the old syntax

like image 615
Philipp Avatar asked Nov 11 '13 18:11

Philipp


1 Answers

You forgot to call the all function:

element.all(by.repeater('user in allUsers')).then(function(rows) {
like image 72
JB Nizet Avatar answered Oct 25 '22 08:10

JB Nizet