how to select jquery unorderded drop down list selenium webdriver
<p>I'm new selenium webdriver using Java. I'm able write java code to select dropdown if it has normal select class something like :-</p>

<pre><code>new Select(driver.findElement(By.id("someid"))).selectByValue("1"));
</code></pre>

<p>But below code has select2 class from jquery. Tried multiple options. I can select to show dropdown by from then, I couldn't select Apple or orange, or select grape.</p>

<p>can some one please help me on how to select Apple from this kind of dropdown list? Any clue or code is much appreciated. ..</p>

<p>this is how code looks like</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="select2-drop" class="select2-drop select2-display-none select2-with-searchbox select2-drop-active" style="somestyleelements"&gt;
 &lt;div class="select2-search"&gt;
  &lt;ul id="select2-results-1" class="select2-results" role="listbox"&gt;
   &lt;li class="select2-results-dept-0 select2-result select2-result-selectable select2-highlighted" role="presentation"&gt;
    &lt;div id="select2-result-label-random" class="select2-result-label" role="option"&gt;
     &lt;span class="select2-match"&gt;&lt;/span&gt;
      Apples
    &lt;/div&gt;
   &lt;/li&gt;
   &lt;li class="select2-results-dept-0 select2-result select2-result-selectable" role="presentation"&gt;
    &lt;div id="select2-result-label-random" class="select2-result-label" role="option"&gt;
     &lt;span class="select2-match"&gt;&lt;/span&gt;
      Orange
    &lt;/div&gt; 
   &lt;li class="select2-results-dept-0 select2-result select2-result-selectable" role="presentation"&gt;
   &lt;li class="select2-results-dept-0 select2-result select2-result-selectable" role="presentation"&gt;
   &lt;li class="select2-results-dept-0 select2-result select2-result-selectable" role="presentation"&gt;
  &lt;/ul&gt;
&lt;/div&gt;</code></pre>
</div>
</div>
</p>

<p>Thanks in advance</p>