I am using Serenity BDD. I have the following code:
@FindBy(id = "privacy-iframe")
WebElementFacade cookieBannerIFrame;
Boolean cookieDisplayed = withTimeoutOf(Duration.ofSeconds(20)).waitFor(cookieBannerIFrame).isPresent();
After 20 seconds, I expect that cookieDisplayed
should be false
, because the iframe element is not there, but I got TimeoutException instead:
.openqa.selenium.TimeoutException: Expected condition failed: waiting for net.serenitybdd.core.pages.RenderedPageObjectView$$Lambda$1098/0x000000e001621100@6719f206 (tried for 20 second(s) with 50 milliseconds interval)
isPresent()
should return a Boolean, according to its document:
Did I misunderstand something? Any help! Thank you in advance.