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#
I have tried the following
.SendKeys(Keys.ArrowDown)
Also I tried locating the element by XPath but as it is dynamic, this isn't working either.
Here is the HTML
<section>
<div class="entry-box">
<input class="inv-input" [ngModel]="value?.ItemValue" (ngModelChange)="updatePhoneNumber($event)"/>
<div class="caret-container" (click)="toggleDropDown()">
<span *ngIf="value?.IsPrimary">{{'contactDetailsTab.selectedPrimaryLabel' | translate}}</span>
<img class="select-icon" src="/assets/app/caret-dark.svg">
</div>
</div>
<ng-container *ngIf="showDropDown">
<div class="dropdown-container">
<ul #dropDown tabIndex="-1" class="dropdown" (blur)="onBlur()">
<li *ngIf="!value?.IsPrimary" (mousedown)="setPrimary(true)">{{'contactDetailsTab.makePrimaryContact' | translate}}</li>
<li *ngIf="value?.IsPrimary" (mousedown)="setPrimary(false)">{{'contactDetailsTab.removePrimaryContact' | translate}}</li>
</ul>
</div>
</ng-container>
</section>