title: How to click on the element with text as "Phone to call with" within <md-select> dropdown through Selenium and Java
body: <p>I am trying to automate an application which has a  type drop down.
  I have tried all possible combinations like below but have not been able to select an element from drop down list.</p>
  
  <pre><code>driver.findElement(By.xpath("//span[@aria-label=\"Phone to call with\"]"));
  </code></pre>
  
  <p>I am not able to find xpath by ID as it keeps changing with reload.</p>
  
  <p><a href="https://i.stack.imgur.com/aVFgc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aVFgc.png" alt="enter image description here"></a></p>
  
  <p>Below is the html code. How would i achieve the same?</p>
  
  <pre><code>&lt;md-select ng-model="ctrl.selectedLinkedPhone" class="ng-pristine ng-valid ng-empty ng-touched" tabindex="0" aria-disabled="false" role="listbox" aria-expanded="false" aria-multiselectable="false" id="select_26" aria-invalid="false" aria-label="
          Phone to call with
        " style=""&gt;&lt;md-select-value class="md-select-value md-select-placeholder" id="select_value_label_25"&gt;&lt;span&gt;
          Phone to call with
        &lt;/span&gt;&lt;span class="md-select-icon" aria-hidden="true"&gt;&lt;/span&gt;&lt;/md-select-value&gt;&lt;div class="md-select-menu-container" aria-hidden="true" role="presentation" id="select_container_27"&gt;&lt;md-select-menu role="presentation" class="_md"&gt;&lt;md-content class="_md"&gt;
          &lt;!----&gt;&lt;md-option ng-disabled="!ctrl.isLinkedPhoneCurrentlyVerified(linkedPhone)" ng-repeat="linkedPhone in ctrl.getLinkedPhones()" ng-value="linkedPhone" tabindex="0" class="md-ink-ripple" role="option" aria-selected="false" id="select_option_29" aria-checked="true" aria-disabled="false" value="[object Object]" style=""&gt;&lt;div class="md-text"&gt;
            Phone 1
          &lt;/div&gt;&lt;/md-option&gt;&lt;!----&gt;&lt;md-option ng-disabled="!ctrl.isLinkedPhoneCurrentlyVerified(linkedPhone)" ng-repeat="linkedPhone in ctrl.getLinkedPhones()" ng-value="linkedPhone" tabindex="0" class="md-ink-ripple" role="option" aria-selected="false" id="select_option_30" aria-checked="true" aria-disabled="false" value="[object Object]" style=""&gt;&lt;div class="md-text"&gt;
            Phone 2
          &lt;/div&gt;&lt;/md-option&gt;&lt;!----&gt;&lt;md-option ng-disabled="!ctrl.isLinkedPhoneCurrentlyVerified(linkedPhone)" ng-repeat="linkedPhone in ctrl.getLinkedPhones()" ng-value="linkedPhone" tabindex="0" class="md-ink-ripple" role="option" aria-selected="false" id="select_option_31" aria-checked="true" aria-disabled="false" value="[object Object]" style=""&gt;&lt;div class="md-text"&gt;
            Hangouts
          &lt;/div&gt;&lt;/md-option&gt;&lt;!----&gt;
        &lt;/md-content&gt;&lt;/md-select-menu&gt;&lt;/div&gt;&lt;/md-select&gt;
  </code></pre>