How to select multiple elements in Selenium (not <Select> - <Option>) How to select multiple elements in Selenium (not <Select> - <Option>) selenium selenium

How to select multiple elements in Selenium (not <Select> - <Option>)


Have you tried using GetElementsByClassName()? Combined with the KeyDown command in the Actions class (See the answer for this question) something like this may work for you...

using OpenQA.Selenium;using OpenQA.Selenium.Firefox;using OpenQA.Selenium.Interactions;var driver = new WebDriver();var elements = driver.GetElementsByClassName("ui-state-default ui-selectee");var action = new Actions(driver);action.KeyDown(Keys.Control);foreach (var element in elements){    // If element properties match your selection    element.Click()}