public static int SetSelectedIndex(this IWebDriver webdriver, string selector, int selectedIndex) { SelectElement element = new SelectElement(webdriver.FindElement(By.CssSelector(selector))); if (selectedIndex >= element.Options.Count) selectedIndex…