public static string GetDropdownValue(IWebElement element) { var selectedOptions = new SelectElement(element).AllSelectedOptions; if (!selectedOptions.Any()) { return(string.Empty); } return(selectedOptions.First().GetAttribute("value")); }