title: How to select a dropdown value by classname in Selenium WebDriver using Java
body: <p>I am new to selenium , currently I am working in it. I want to select a value from the drop down. The ul class="ns-dropdown" and the option is many in that am trying to select and load Australian Dollar page.</p>
  
  <p>Here is the Html tag:</p>
  
  <pre><code>&lt;ul class="ns-dropdown"&gt;
  &lt;li class="ns-option&gt;&lt;a class="c36 noUnderline"&gt;USD&lt;/a&gt;&lt;/li&gt;
  &lt;li class="ns-option&gt;&lt;a class="c36 noUnderline"&gt;AUD&lt;/a&gt;&lt;/li&gt;
  &lt;li class="ns-option&gt;&lt;a class="c36 noUnderline"&gt;NZD&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>Here is the code I tried</p>
  
  <pre><code>WebElement dropDownListBox = driver.findElement(By.className("ul.ns-dropdown")); 
  Select clickThis = new Select(dropDownListBox);
  clickThis.selectByValue("Australian Dollar");
  </code></pre>
  
  <p>But this not worked.</p>
  
  <p>Please suggest me some ways to set the drop down value.</p>
  
  <p>Thank You!</p>