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="">
2
  • Can you please provide a sample of the HTML structure you are working with? Commented Nov 14, 2017 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
    Commented Nov 14, 2017 at 19:51

0

Browse other questions tagged or ask your own question.