title: How does one use Selenium Webdriver : to choose text from a dynamic combobox with tag <aria-activedescendant>?
body: <p>This is the html:</p>
  
  <pre><code>&lt;select select2="" id="id_event_operator" value.bind="model.operator" 
  style="width:100%;display:block" class="au-target select2-hidden-accessible" 
  au-target-id="134" data-select2-id="id_event_operator" tabindex="-1" aria- 
  hidden="true"&gt; &lt;option model.bind="op.id" class="au-target" au-target-id="135" 
  data-select2-id="2"&gt;--- None ---&lt;/option&gt;&lt;option model.bind="op.id" class="au- 
  target" au-target-id="135" data-select2- 
  id="11"&gt;liveeventuplynktest01@test.com&lt;/option&gt;&lt;option model.bind="op.id" 
  class="au-target" au-target-id="135" data-select2- 
  id="12"&gt;uplynkcmsseleniumtestaccount@test.com&lt;/option&gt;&lt;!--anchor--&gt; &lt;/select&gt;
  
  
  &lt;span class="select2 select2-container select2-container--default select2- 
  container--below select2-container--open" dir="ltr" data-select2-id="1" 
  style="width: 100%;"&gt;&lt;span class="selection"&gt;
  
  &lt;span class="select2-selection 
  select2-selection--single" role="combobox" aria-haspopup="true" aria- 
  expanded="true" tabindex="0" aria-labelledby="select2-id_event_operator- 
  container" aria-owns="select2-id_event_operator-results" aria- 
  activedescendant="select2-id_event_operator-result-q5d6- 
  liveeventuplynktest01@test.com"&gt;
  
  &lt;span class="select2-selection__rendered" 
  id="select2-id_event_operator-container" role="textbox" aria-readonly="true" 
  title="--- None ---"&gt;--- None ---&lt;/span&gt;
  
  &lt;span class="select2-selection__arrow" 
  role="presentation"&gt;&lt;b role="presentation"&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
  
  &lt;span class="dropdown-wrapper" aria-hidden="true"&gt;&lt;/span&gt;&lt;/span&gt;
  </code></pre>
  
  <p>The value of the "aria-activedescendant" keeps on changing as I hover over the elements in the combobox. </p>
  
  <p>How can I grab the value in combobox and set it to the textbox element.Clicking on the "class="select2-selection select2-selection--single" element is not setting the textbox value when I am doing it through the code, but it works if I manually do it from UI.</p>
  
  <p><a href="https://i.stack.imgur.com/eww8q.png" rel="nofollow noreferrer">This is how the web page looks like</a></p>
  
  <p>This is my code:</p>
  
  <pre><code>public class LiveEventsPage extends PageObject {
  
  @FindBy(xpath = "/html/body/router- 
  view/div[4]/div/div[2]/div/form/ul/li[1]/span/span[1]/span/span[2]")
  private WebElement eventOperatorDropDownButton;
  
  public void setEventOperator(String dropDownElem){
      waitForElemToBeClickable(eventOperatorDropDownButton).click();
      driver.findElement(By.xpath("//span[contains(@aria- 
      activedescendant,'liveeventuplynktest01@test.com')]")).click();
  }
  }
  </code></pre>