title: Protractor testing angular ng-options
body: <p>I four <code>&lt;select&gt;</code> with <code>ng-options</code> used in my page that will retrieve different information.
  All of them are like this, except with different data binding, names and ids:</p>
  
  <pre><code>&lt;div class="col-sm-3"&gt;
     &lt;label class="control-label" for="lawyer"&gt;Lawyer&lt;/label&gt;
     &lt;select class="form-control" id="lawyer" name="lawyer" ng-model="model.lawyerUuid" required
        ng-options="lawyer.uuid as lawyer.name for lawyer in model.lawyers"&gt;
     &lt;/select&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How can I test this in protractor so I can make sure there are only x (e.g. 2) lawyers returned ?</p>
  
  <p>Since I use <code>ng-options</code>, finding by <code>ng-repeat</code> won't work and if I search with the following, I will get all four <code>&lt;selects&gt;</code> in my page and not only the one above (so if all of them would return 2 elements I would have a <code>count()</code> of 8):</p>
  
  <pre><code>element.all(by.css('select option'))
  </code></pre>
  
  <p>Is there a way to retrieve all the elements that have a parent with some specified id?</p>