I have a scenario that results in one of many validation icons appearing. I need to be able to assert that any one of them is visible but I have problems because of the other ones that remain hidden.

I'm using SeleniumExtras.WaitHelpers here: Wait.AWait.Until(ExpectedConditions.ElementToBeClickable(By.CssSelector(a.error_Icon))); but this always fails (due, I think, to the other icons that remain hidden which have the same class) but when I use the id for a specific element for a particular scenario, it works:


The hidden icons are in a span element with this attribute: style="display:none;"

The unhidden icon's span element does not have style="display:inline;" or anything else that I can see to use.

So, is there a way for me to use the first choice where I only use one selector for all scenarios?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.