How can I tell Selenium webdriver to wait on a specific element to have a specific attribute set in css?
I want to wait for:
element.getCssValue("display").equalsIgnoreCase("block")
Usually one waits for elements to be present like this:
webdriver.wait().until(ExpectedConditions.presenceOfElementLocated(By.id("some_input")));
How can I wait for the specific css value of display
attribute?
I think this would work for you.
webdriver.wait().until(ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@id='some_input'][contains(@style, 'display: block')]")));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With