Question: I am having tough time in selecting value from drop down using C# binding of WebDriver. I have worked on neither C# nor WebDriver in past. I am using WebDriver - Selenium-dotnet2.0b3 with Visual Studio C# 2010 Express edition.
I have added WebDriver.Common, WebDriver.Firefox and WebDriver.Remote to my solution. I tried using this -

```
IWebElement dateOfBirth = webdriver.FindElement(By.Id("join_birth_day"));
List<IWebElement> dateOfBirthOptions = (List<IWebElement>)dateOfBirth.FindElement(By.TagName("option"));

foreach(IWebElement dateOfBirthOption in dateOfBirthOptions)  
{
    if (dateOfBirthOption.Equals("3"))
    {
        dateOfBirthOption.Select();
    }
}

```

But got to see error, when running my solution in NUnit

```
LiveCams.CreateAccount.createAccount:
System.InvalidCastException : Unable to cast object of type 'OpenQA.Selenium.Firefox.FirefoxWebElement' to type 'System.Collections.Generic.List`1[OpenQA.Selenium.IWebElement]'.

```

And if I don't cast then would not be able to even build the solution.
I guess I am missing some thing trivial here. Any one who could guide me here?
Drop down selection used to be so simple in Selenium 1.0 :-/

Answer: 
1) Using a SelectElement as already commented - [How to select an option from drop down using Selenium WebDriver C#?](https://stackoverflow.com/questions/5278281/how-to-using-webdriver-selenium-for-selecting-an-option-in-c) The SelectElement belongs to the **OpenQA.Selenium.Support.UI** namespace.

2) You could also do something like this with css selectors:

```cs
WebElement dateOfBirth =  webdriver.FindElement(By.Id("join_birth_day"))
                              .FindElement(By.CssSelector("option[value='3']")).Select();

```
To select an Option from Drop Down use the below code 

1. To select a value based on Text

```
new SelectElement(driver.FindElement(By.XPath(""))).SelectByText("");

```
2. To select a value based on Value

```
new SelectElement(driver.FindElement(By.XPath(""))).SelectByValue("");

```
3. To select a value based on Index

```
new SelectElement(driver.FindElement(By.XPath(""))).SelectByIndex(0);

```