title: I want to select each value in dropdown and it is coming dynamically to do unit testing using protractor
body: <p>This is my select tag</p>
  
  <pre><code> &lt;select id="selectPrimaryObject" class="form-control" ng-change="getPrimaryRelations()" ng-model="relation.from"&gt;
                  &lt;option id="md-option" ng-repeat="item in primaryObjectsList" value="{{item.id}}"&gt;{{item.name}}&lt;/option&gt;
              &lt;/select&gt;
  </code></pre>
  
  <p>And my protractor code is</p>
  
  <pre><code> element.all(by.id('selectPrimaryObject')).each(function (values, index) {
          values.click();                    // select the &lt;select&gt;
          browser.driver.sleep(5000);              // wait for the renderings to take effect
          element.all(by.id('md-option')).click();   // select the first md-option
          browser.driver.sleep(5000);              // wait for the renderings to take effect
      });
  </code></pre>
  
  <p>It is selecting last item from dropdown, but I want each item to be selected one by one.</p>