title: Autocomplete Drop down selection in selenium webdriver
body: <p>I need to select the address from the auto complete drop down in selenium webdriver.</p>
  
  <p>I have added the inspect element source of the drop down box as follows,</p>
  
  <pre><code>&lt;head&gt;
  &lt;body&gt;
  &lt;input id="gridLogId" name="gridLogId" value="qOZcnJEE/G9A+fAN/C4PlA==" type="hidden"/&gt;
  &lt;div id="wrapper"&gt;
  &lt;div id="confirmation-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt;
  &lt;script id="subscriptiondetailTemplate" type="text/x-kendo-template"&gt;   # for (var i = 0; i &lt; data.length; i++) { # &lt;span class="kendoTooltip cursorpointer subs_IAM fa subs_#= data[i].PlanCode#" title="Plan description : #= data[i].PlanDesc #&lt;br&gt;Expiry on : #= data[i].ExpiryOnLabel #"&gt;#= data[i].PlanDesc #&lt;/span&gt; # } # &lt;/script&gt;
  &lt;script&gt;   var subscriptionTemplate = kendo.template($('#subscriptiondetailTemplate').html()); &lt;/script&gt;
  &lt;style&gt;   body { overflow: hidden !important; } &lt;/style&gt;
  &lt;ul id="ui-id-1" class="ui-autocomplete ui-front ui-menu ui-widget ui-widget-content ui-corner-all" tabindex="0" style="display: none;"/&gt;
  &lt;div class="k-list-container k-popup k-group k-reset" data-role="popup" style="display: none; position: absolute;"&gt;
  &lt;div id="Finyear_OWtyUEpDYnYyMFU9-list" class="k-list-container k-popup k-group k-reset" data-role="popup" style="display: none; position: absolute;"&gt;
  &lt;ul id="ui-id-2" class="ui-autocomplete ui-front ui-menu ui-widget ui-widget-content ui-corner-all" tabindex="0" style="display: block; width: 444px; top: 742.85px; left: 460.133px;"&gt;
  &lt;li class="ui-menu-item" role="presentation"&gt;
  &lt;a id="ui-id-303" class="ui-corner-all" tabindex="-1"&gt;SYDNEY, New South Wales, Australia, 1001&lt;/a&gt;
  &lt;/li&gt;
  &lt;li class="ui-menu-item" role="presentation"&gt;
  &lt;a id="ui-id-304" class="ui-corner-all" tabindex="-1"&gt;SYDNEY, New South Wales, Australia, 1002&lt;/a&gt;
  &lt;/li&gt;
  &lt;li class="ui-menu-item" role="presentation"&gt;
  &lt;a id="ui-id-305" class="ui-corner-all" tabindex="-1"&gt;SYDNEY, New South Wales, Australia, 1003&lt;/a&gt;
  &lt;/li&gt;
  &lt;li class="ui-menu-item" role="presentation"&gt;
  &lt;a id="ui-id-306" class="ui-corner-all" tabindex="-1"&gt;SYDNEY, New South Wales, Australia, 1005&lt;/a&gt;
  &lt;/li&gt;
  &lt;li class="ui-menu-item" role="presentation"&gt;
  &lt;li class="ui-menu-item" role="presentation"&gt;
  &lt;li class="ui-menu-item" role="presentation"&gt;
  &lt;li class="ui-menu-item" role="presentation"&gt;
  &lt;li class="ui-menu-item" role="presentation"&gt;
  </code></pre>
  
  <p>I need to select the "SYDNEY, New South Wales, Australia, 1001" drop down value from the autocomplete box. Please suggest me some idea. I have used the following code but it is not working,</p>
  
  <pre><code>driver.findElement(By.id("ResidentialOrBusinessAddress_City")).sendKeys("Sydney");
          Thread.sleep(1000);
          java.util.List&lt;WebElement&gt; autoSuggest = driver.findElements(By.partialLinkText("1001"));
          driver.findElement(By.id("ResidentialOrBusinessAddress_Region")).sendKeys("NSW");
          Thread.sleep(1000);
          java.util.List&lt;WebElement&gt; autoSuggest1 = driver.findElements(By.partialLinkText("1001"));
          driver.findElement(By.id("ResidentialOrBusinessAddress_PostCode")).sendKeys("1001");
          Thread.sleep(1000);
          java.util.List&lt;WebElement&gt; autoSuggest2 = driver.findElements(By.partialLinkText("1001"));
          driver.findElement(By.id("ResidentialOrBusinessAddress_Country")).sendKeys("Australia");
          Thread.sleep(1000);
          java.util.List&lt;WebElement&gt; autoSuggest3 = driver.findElements(By.partialLinkText("Australia"));
  </code></pre>
  
  <p>Please suggest me how to get that values. I have attached the screen shots of the page along with this.<a href="https://i.stack.imgur.com/MCJG2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MCJG2.png" alt="enter image description here"></a></p>
  
  <p>Thank you.</p>