title: how to select a dropdown value in selenium webdriver using node.js
body: <p>I have following HTML structure:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;button class=&quot;dropdown-toggle selectpicker btn btn-primary&quot; data-toggle=&quot;dropdown&quot; type=&quot;button&quot; data-id=&quot;strategic_reseller_country&quot; title=&quot;United States&quot;&gt;
  &lt;div class=&quot;dropdown-menu open&quot; style=&quot;max-height: 245.6px; overflow: hidden; min-height: 40px;&quot;&gt;
     &lt;ul class=&quot;dropdown-menu inner selectpicker&quot; role=&quot;menu&quot; style=&quot;max-height: 243.6px; overflow-y: auto; min-height: 38px;&quot;&gt;
        &lt;li class=&quot;&quot; rel=&quot;0&quot;&gt;
           &lt;a class=&quot;&quot; style=&quot;&quot; tabindex=&quot;0&quot;&gt;
           &lt;span class=&quot;text&quot;/&gt;
           &lt;i class=&quot;glyphicon glyphicon-ok icon-ok check-mark&quot;/&gt;
           &lt;/a&gt;
        &lt;/li&gt;
        &lt;li rel=&quot;1&quot;&gt;
           &lt;a class=&quot;&quot; style=&quot;&quot; tabindex=&quot;0&quot;&gt;
           &lt;span class=&quot;text&quot;&gt;Andorra&lt;/span&gt;
           &lt;i class=&quot;glyphicon glyphicon-ok icon-ok check-mark&quot;/&gt;
           &lt;/a&gt;
        &lt;/li&gt;
        &lt;li rel=&quot;2&quot;&gt;
           &lt;a class=&quot;&quot; style=&quot;&quot; tabindex=&quot;0&quot;&gt;
           &lt;span class=&quot;text&quot;&gt;United Arab Emirates&lt;/span&gt;
           &lt;i class=&quot;glyphicon glyphicon-ok icon-ok check-mark&quot;/&gt;
           &lt;/a&gt;
        &lt;/li&gt;
        &lt;li rel=&quot;3&quot;&gt;
           &lt;a class=&quot;&quot; style=&quot;&quot; tabindex=&quot;0&quot;&gt;
           &lt;span class=&quot;text&quot;&gt;Afghanistan&lt;/span&gt;
           &lt;i class=&quot;glyphicon glyphicon-ok icon-ok check-mark&quot;/&gt;
           &lt;/a&gt;
        &lt;/li&gt;
        &lt;li rel=&quot;4&quot;&gt;
        &lt;li rel=&quot;5&quot;&gt;
        &lt;li rel=&quot;6&quot;&gt;
        &lt;li rel=&quot;7&quot;&gt;
        &lt;li rel=&quot;8&quot;&gt;
        &lt;li rel=&quot;9&quot;&gt;
           &lt;a class=&quot;&quot; style=&quot;&quot; tabindex=&quot;0&quot;&gt;
           &lt;span class=&quot;text&quot;&gt;Netherlands Antilles&lt;/span&gt;
           &lt;i class=&quot;glyphicon glyphicon-ok icon-ok check-mark&quot;/&gt;
           &lt;/a&gt;
        &lt;/li&gt;
     &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  <p>So how could I get the item from list?</p>
  <p>I am new to <code>Node.Js</code> (JavaScript) so I don't know how to achieve it in <code>node.Js</code> but it can be achieved in java as follows :</p>
  <pre class="lang-js prettyprint-override"><code>Select dropdown = new Select(driver.findElement(By.class(&quot;dropdown-menu inner selectpicker&quot;))); 
  dropdown.selectByVisibleText(&quot;Andorra&quot;);
  </code></pre>