Selenium WebDriver C# code for selecting item from Drop Down:
IWebElement EducationDropDownElement = driver.FindElement(By.Name("education"));
SelectElement SelectAnEducation = new SelectElement(EducationDropDownElement);
There are 3 ways to select drop down item: i)Select by Text ii) Select by Index iii) Select by Value
Select by Text:
SelectAnEducation.SelectByText("College");//There are 3 items - Jr.High, HighSchool, College
Select by Index:
SelectAnEducation.SelectByIndex(2);//Index starts from 0. so, 0 = Jr.High 1 = HighSchool 2 = College
Select by Value:
SelectAnEducation.SelectByValue("College");//There are 3 values - Jr.High, HighSchool, College