Reputation: 31
I am trying to select all the todo's on https://www.angularjs.org/. However its only changing the first one. How do I select all the elements:
element.all(by.repeater('todo in todoList.todos')).then(function(rows) {
for (var i = 0; i < rows.length; ++i) {
element.all(by.repeater('todo in todoList.todos')).get(i).element(by.model('todo.done')).click();
}
});
Upvotes: 1
Views: 492
Reputation: 281
var todos = element.all(by.repeater('todo in todoList.todos'));
todos.get(1).click();
todos.get(2).click();
element.all will collect all elements of givent locator and get() will select the element specific element. It works like array.
Upvotes: 0