3
<tr id="item" ng-repeat="item in itemList>
   <td id="code" ng-repeat="column in columns">Some Text</td>
</tr>

I've seen some other similar questions but I couldn't solve it yet. Thats what I've tried so far:

element.all(by.repeater('column in columns')).findElement(by.id('code')).getText('Some Text').click();

EDIT:

<tr ng-repeat="item in items>
<td>{{item.name}}</td>
<td>{{item.description}}</td>
</tr>

Which results in:

<tr>
<td>Some Name</td>
<td>Some Text</td>
</tr>
<tr>
<td>More Name</td>
<td>More Text</td>
</tr>

etc etc

noneJavaScript
  • 835
  • 3
  • 21
  • 41
  • I think **protractor** comes in picture when you are about to make a `$http` request. – Ashish Kumar Jun 02 '15 at 11:42
  • will got same id in the loop, try and use findElement(by.id('row_0')) to click first row. And if you have unique 'id' across page, no need to select by.repeater('column in columns') before. I think – Dmitri Algazin Jun 02 '15 at 13:02

1 Answers1

4

You need to filter() the desired element:

var columns = element.all(by.repeater('column in columns'));
columns.filter(function (elm) {
    return elm.getText().then(function (text) {
        return text == 'Some Text';
    });
}).first().click();
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195