Using OR Condition in Selenium WebDriver for any selector

To get all web elements on the page that have a specific class names, i.e. “blue” or “purple”

WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(20));
IWebElement status = wait.Until(d => d.FindElement(By.XPath(“//span[@class=’blue’ or @class=’purple’]”)));

Leave a comment