1

I am looking to find out how to get the value for a dropdown from an angularjs dropdown (for country).

I found the special handling needed for basic text fields:

Driver.Instance.FindElement(By.XPath("//input[@name='firstName']")).GetAttribute("value");

But cannot find the value for the dropdown or any examples of how to do this. Am I missing something simple? I would assume a solution for this would be out there, especially with finding examples with an input field.

Here is the html as asked:

<input type="text" autocomplete="off" tabindex="-1" aria-expanded="true" aria-label="Select box" aria-owns="ui-select-choices-3" aria-activedescendant="ui-select-choices-row-3-263" class="form-control ui-select-search ng-pristine ng-valid ng-touched" placeholder="Choose Country" ng-model="$select.search" ng-show="$select.searchEnabled &amp;&amp; $select.open" style="">
  • Can you please provide a sample of the HTML structure you are working with? – Tired Of Testing Nov 14 '17 at 16:54
  • This question will not be useful without the html of the element you are trying to interact with, the code you are using to try to access it, and the error you are getting when you try. sqa.stackexchange.com/questions/28891/… might be a duplicate of your question. – Kate Paulk Nov 14 '17 at 19:51