title: Selenium select not working on some objects
body: <p>I am having trouble with setting a Select object through Selenium. This Select object has some JavaScript associated with it that populates it's 'options' when the page is loaded. I believe this is causing it to behave differently. Normally I can set a Select object with the following:</p>
  
  <pre><code>SelectElement sel = new SelectElement(ele);
  sel.SelectByText(value);
  </code></pre>
  
  <p>With this specific object, the same code will execute successfully (no exceptions thrown), however the value does not get set. Note that I put sleeps and re-trys in and I am confident the Select object is fully loaded before the code is executed (otherwise an exception would occur). </p>
  
  <p>The two Select objects giving me this trouble also appear different from standard html Select objects which reinforces my belief that they are not standard Selects. The first two drop downs in this image are the troublesome ones, while the rest work as expected:
  <img src="https://i.stack.imgur.com/Wk0ot.png" alt="enter image description here"></p>
  
  <p>Unfortunately this is a private page that I cannot give you access to, but hopefully this HTML snippet is enough:</p>
  
  <pre><code>&lt;h3&gt;Details of your primary qualification, examination, or assessment&lt;/h3&gt;
  
  &lt;script type="text/javascript" src="/assets/js/jquery.ui.widget.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="/assets/js/jquery.ui.position.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="/assets/js/jquery.ui.selectmenu.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt; 
      j$(document).ready(function () {
          j$(".field [id$='_drpInstitution']").selectmenu();
          j$(".field [id$='_drpName']").selectmenu();
  
          j$(".field [id$='_drpInstitution']").change(function () {
              __doPostBack('content_0$ucCourse$drpInstitution', '');
          });
  
          j$(".field [id$='_drpName']").change(function () {
              __doPostBack('content_0$ucCourse$drpName', '');
          });
  
      });
  
  
  &lt;/script&gt;
  &lt;div class="field"&gt;                 
      &lt;label for="content_0_ucCourse_drpInstitution" id="content_0_ucCourse_lblInstitution"&gt;Name of Australian institution (university/college/examining body):&lt;em class="required"&gt;*&lt;/em&gt;&lt;/label&gt;
      &lt;select name="content_0$ucCourse$drpInstitution" id="content_0_ucCourse_drpInstitution" class="field-l Institution"&gt;
          &lt;option value="-1"&gt;- Select -&lt;/option&gt;
          &lt;option selected="selected" value="Australian Catholic University"&gt;Australian Catholic University&lt;/option&gt;
          &lt;option value="Avondale College of Higher Education"&gt;Avondale College of Higher Education&lt;/option&gt;
          &lt;option value="Central Queensland University"&gt;Central Queensland University&lt;/option&gt;
          &lt;option value="Charles Darwin University"&gt;Charles Darwin University&lt;/option&gt;
          &lt;option value="Other"&gt;- Other -&lt;/option&gt;
  
      &lt;/select&gt;
      &lt;em class="hint"&gt;If your institution does not appear in the list, please select 'Other' and enter your institution in the text box that appears.&lt;/em&gt;
      &lt;span id="content_0_ucCourse_vldInstitution" style="display:none;"&gt;&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>When I inspect the Dropdown box, instead of getting the Select object I get the following Span:</p>
  
  <pre><code>&lt;span&gt;
      &lt;a class="ui-selectmenu ui-widget ui-state-default ui-selectmenu-dropdown ui-state-active ui-corner-top" id="content_0_ucCourse_drpInstitution-button" role="button" href="#nogo" tabindex="0" aria-haspopup="true" aria-owns="content_0_ucCourse_drpInstitution-menu" style="width: 460px;" aria-disabled="false"&gt;
          &lt;span class="ui-selectmenu-status"&gt;Australian Catholic University&lt;/span&gt;
          &lt;span class="ui-selectmenu-icon ui-icon ui-icon-triangle-1-s"&gt;&lt;/span&gt;
      &lt;/a&gt;
  &lt;/span&gt;
  </code></pre>
  
  <p>When I inspect the resulting drop down list, I get a UL located in the footer:</p>
  
  <pre><code>&lt;div class="ui-selectmenu-menu" style="z-index: 2; top: 786px; left: 741px;"&gt;
      &lt;ul class="ui-widget ui-widget-content ui-selectmenu-menu-dropdown ui-corner-bottom" aria-hidden="true" role="listbox" aria-labelledby="content_0_ucCourse_drpInstitution-button" id="content_0_ucCourse_drpInstitution-menu" style="width: 460px; height: 189px;" aria-disabled="false" tabindex="0" aria-activedescendant="ui-selectmenu-item-562"&gt;
          &lt;li role="presentation" class=""&gt;&lt;a href="#nogo" tabindex="-1" role="option" aria-selected="false"&gt;- Select -&lt;/a&gt;&lt;/li&gt;
          &lt;li role="presentation" class="ui-selectmenu-item-selected"&gt;&lt;a href="#nogo" tabindex="-1" role="option" aria-selected="true" id="ui-selectmenu-item-562"&gt;Australian Catholic University&lt;/a&gt;&lt;/li&gt;
          &lt;li role="presentation" class=""&gt;&lt;a href="#nogo" tabindex="-1" role="option" aria-selected="false"&gt;Avondale College of Higher Education&lt;/a&gt;&lt;/li&gt;
          &lt;li role="presentation"&gt;&lt;a href="#nogo" tabindex="-1" role="option" aria-selected="false"&gt;University of Wollongong&lt;/a&gt;&lt;/li&gt;
          &lt;li role="presentation"&gt;&lt;a href="#nogo" tabindex="-1" role="option" aria-selected="false"&gt;Victoria University&lt;/a&gt;&lt;/li&gt;
          &lt;li role="presentation" class="ui-corner-bottom"&gt;&lt;a href="#nogo" tabindex="-1" role="option" aria-selected="false"&gt;- Other -&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>None of this appears in the Page Source, so it is all generated on the fly. I am currently working around the Select issue by clicking the hyperlink object <code>id=content_0_ucCourse_drpInstitution-button</code> and then clicking the hyperlink object <code>text=Australian Catholic University</code></p>
  
  <p>Any better workarounds would be appreciated.</p>