title: How to get all options in a drop-down list by Selenium WebDriver using C#?
body: <p>I'm new to both C# and Selenium WebDriver.</p>
  
  <p>I know how to select/click on an option in a drop-down list, but I've a problem before that.  Since the drop-down list is dynamically generated, I have to get all options/values from the list before running each case.</p>
  
  <p>Is there anyone kindly tell me how to get all values/options from a drop-down list.  I'm using IE and I didn't find any class which supports method to get values/options in Selenium.IE namespace for C#.</p>
  
  <p>My example:
  A list contains several time zones:</p>
  
  <pre><code>&lt;TD&gt;
    &lt;select name = "time_zone"&gt;
      &lt;option value "-09:00"&gt;&lt;script&gt;timezone.Alaska&lt;/script&gt;&lt;/option&gt;
      &lt;option value "+00:00"&gt;&lt;script&gt;timezone.England&lt;/script&gt;&lt;/option&gt;
      &lt;option value "+02:00"&gt;&lt;script&gt;timezone.Greece&lt;/script&gt;&lt;/option&gt;
      &lt;option value "+05:30"&gt;&lt;script&gt;timezone.India&lt;/script&gt;&lt;/option&gt;
    &lt;/select&gt;
  &lt;TD&gt;
  </code></pre>
  
  <p>This is a drop-down list in an IE page and how to get the dynamically generated time zone list?</p>
  
  <p>My code:</p>
  
  <pre><code>IWebElement elem = driver.FindElement(By.XPath("//select[@name='time_zone']"));
  List&lt;IWebElement&gt; options = elem.FindElements(By.TagName("option"));
  </code></pre>
  
  <p>C# just pops an Error:
  Cannot implicitly covert type 'OpenQA.Selenium.IWebElement' to 'System.Collections.Generic.List'.  An explicit conversion exists (are you missing a cast?).</p>
  
  <p>thanks.</p>