Affecto.Testing.UI.Selenium.WebHostDriver.GetDropDownListElement C# (CSharp) Method

GetDropDownListElement() private method

private GetDropDownListElement ( string labelAndDropDownListElementId, string label ) : IWebElement
labelAndDropDownListElementId string
label string
return IWebElement
        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));
        }