Monday 21 November 2011

How to handle DropDown list in selenium webdriver using Csharp

var selectCountry = driver.FindElement(By.Name("country")); // country is the name of the dropdown element
var selectedcountry = new SelectElement(selectCountry);  // Select element in dropdown
selectedcountry.SelectByText("INDIA ");           // Select value in list by using text. 

We can select values by using Index, value also

1 comment:

  1. Pl let me know how to choose multiple options in combo box.

    ReplyDelete