Is there a way to access the iterator index/key when looking for elements by repeater?
protractor.By.repeater("(id,cat) in pets")
In this case I'm looking to get access to "id" of the cat. The "id" is NOT one of the columns displayed as a value in the table, it is used for navigation as ng-click="goto('/pets/'+cat.id)". There is no binding in the HTML such as {{id}} or {{cat.id}} so doing the following:
ptor.findElements(protractor.By.repeater("(id,cat) in pets").column('cat.id'))
returns an empty element: []
I've also, unsuccessfully, tried doing something like:
ptor.findElement(protractor.By.repeater("(id,cat) in pets").row(0).column('cat.id'))
What is the correct way to access that specific index?
Here's the non-shortened syntax of the answer by Jmr:
ptor.findElements(protractor.By.repeater('(id, cat) in pets')).then(function (arr) {
arr[0].evaluate('cat.id').then(function (id) {
console.log(id);
});
});