title: How to select a value from an angular dropdown in C# with selenium
body: <p>I'm trying to click a value from an angular dropdown. When I click on the dropdown arrow, an option becomes available to 'Make Primary Contact' which I want to click using Selenium WebDriver and C#</p>
  
  <p>I have tried the following</p>
  
  <p>.SendKeys(Keys.ArrowDown)</p>
  
  <p>Also I tried locating the element by XPath but as it is dynamic, this isn't working either.</p>
  
  <p>Here is the HTML</p>
  
  <pre><code>&lt;section&gt;
  &lt;div class="entry-box"&gt;
      &lt;input class="inv-input" [ngModel]="value?.ItemValue" (ngModelChange)="updatePhoneNumber($event)"/&gt;
  
       &lt;div class="caret-container" (click)="toggleDropDown()"&gt;
          &lt;span *ngIf="value?.IsPrimary"&gt;{{'contactDetailsTab.selectedPrimaryLabel' | translate}}&lt;/span&gt;
          &lt;img class="select-icon" src="/assets/app/caret-dark.svg"&gt;
      &lt;/div&gt; 
  &lt;/div&gt;
  &lt;ng-container *ngIf="showDropDown"&gt;
      &lt;div  class="dropdown-container"&gt;
          &lt;ul #dropDown tabIndex="-1" class="dropdown" (blur)="onBlur()"&gt;
              &lt;li *ngIf="!value?.IsPrimary" (mousedown)="setPrimary(true)"&gt;{{'contactDetailsTab.makePrimaryContact' | translate}}&lt;/li&gt;
              &lt;li *ngIf="value?.IsPrimary" (mousedown)="setPrimary(false)"&gt;{{'contactDetailsTab.removePrimaryContact' | translate}}&lt;/li&gt;
          &lt;/ul&gt;
      &lt;/div&gt;
  &lt;/ng-container&gt;
  &lt;/section&gt;
  </code></pre>