title: Can't find an element in a dropdown list - Selenium
body: <p>I want to find an element in a dropdown list in my Selenium test. I use firebug to find the xpath, but my Selenium code can not find the xpath. I am looking for option value number 2 in the html code below:</p>
  
  <pre><code>&lt;div id="accountList_gbselect" class="gb-select text-luc3" style=""&gt; 
      &lt;a class="text-luc3" href="#"&gt;Konto: xxxxxx    0 kr&lt;/a&gt;
      &lt;select id="accountList" style="width: 300px; display: none;" onchange="submit();" size="1" name="accountList"&gt;
          &lt;option value="1xxxxx" selected="selected"&gt;Konto: 1xxxxxx    0 kr&lt;/option&gt;
          &lt;option value="1xxxxx"&gt;Testname: 1xxxxx    6 771 kr&lt;/option&gt;
          &lt;option value="5xxxxx"&gt;Konto: 5xxxxx    500 kr&lt;/option&gt;
      &lt;div class="list"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>In my Selenium code I use findElement and I have tried xpath and cssSelector. But can not get it to work. This is how I thought I should write to find the element in the dropdown list:</p>
  
  <pre><code>driver.findElement(By.xpath(".//*[@id='accountList']/option[2]")).click();
  </code></pre>