private IWebElement GetDropDownListElement(string labelAndDropDownListElementId, string label)
{
foreach (IWebElement labelAndDropDownList in Value.FindElements(By.Id(labelAndDropDownListElementId)))
{
IWebElement labelElement = labelAndDropDownList.FindElement(By.TagName("label"));
if (labelElement.Text.Equals(label))
{
return labelAndDropDownList.FindElement(By.TagName("select"));
}
}
throw new ArgumentException(string.Format("Label '{0}' not found in element '{1}'.", label, labelAndDropDownListElementId));
}