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="">

closed as off-topic by c32hedge, alecxe Nov 14 '17 at 17:32

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers." – c32hedge, alecxe
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 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