问题描述:

Using Protractor, I'm having issues locating a repeater which is nested inside another repeater but not as a direct child element.

Example:

<li ng-repeat="1 in hello">

<div>

<div ng-repeat"2 in hey">

</div>

</li>

The technique I use for finding nested items assumes the element is a direct child as shown here https://github.com/angular/protractor/blob/master/docs/locators.md

网友答案:
element.all(by.repeater('outer')).get(0).all(by.repeater('inner'))...

will find all repeated elements inside first element of outer repeater. you can play with it using filtering to get elements you need.

网友答案:

you can always make unique id for div element

<li ng-repeat="i in hello" id="{{i}}">
  <div>
     <div ng-repeat"j in hey" id="{{i}}:{{j}}">
  </div>
</li>

and find element by id

相关阅读:
Top