title: How do I select an option inside an <li> tag using Selenium Webdriver in java?
body: <p>I tried using cssSelector and using xpath but could not find how to select one value from the list.</p>
  
  <pre><code>r.driver.findElement(By.xpath("//div[contains(.,'DOLO -650')]"));
  r.driver.findElement(By.className("ui-autocomplete ui-front ui-menu ui-widget ui-widget-content")).click(); 
  List&lt;WebElement&gt; opt = r.driver.findElements(By.xpath("//ul[@class='ui-autocomplete ui-front ui-menu ui-widget ui-widget-content']/li")); 
  
  for (WebElement options:opt) {
      if(options.getText().equals(opt)) {
          options.click(); return;
      } 
  } 
  
  WebElement dd = r.driver.findElement(By.id("ui-id-1")); dd.click(); 
  dd.findElement(By.cssSelector("li[value="+ Product+"]")).click();
  r.driver.findElement(By.cssSelector("li:nth-child(1).NoBulle‌​t.jms-bullet&gt;")).cli‌​ck();
  WebElement element = r.driver.findElement(By.name("DOLO -650")); 
  element.sendKeys("DOLO -650"); 
  element.submit(); 
  
  &lt;ul id="ui-id-1" class="ui-autocomplete ui-front ui-menu ui-widget ui-widget-content"&gt; 
      &lt;li id="ui-id-6" class="ui-menu-item"&gt;DOLO -120 60ML&lt;/li&gt; 
      &lt;li id="ui-id-7" class="ui-menu-item ui-state-focus"&gt;DOLO -650&lt;/li&gt;
      &lt;li id="ui-id-8" class="ui-menu-item"&gt;DOLO 100ML&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>