Why is there no "ElementsLocatedBy" ExpectedConditions method that returns a Boolean? Couldn't one be added?
static ExpectedCondition<WebElement> visibilityOfElementLocatedBy(By locator)
I think that SINCE this method returns a WebElement, a far better, less confusing name would have been:
static ExpectedCondition<WebElement> returnVisibleElementLocatedBy(By locator)
And if that was the case, then visibilityOf could return a Boolean instead (and made safe from returning exceptions) :
static ExpectedCondition<Boolean> visibilityOfElementLocatedBy(By locator)
I tried to post on Selenium Developers google group but the permissions didn't allow me.
Wait<WebDriver> wait = new FluentWait<>(driver).withTimeout(5, TimeUnit.SECONDS);
Boolean cond = wait.until(visibilityOfElementLocated(By.id("errorMessage")))
softAssert.assertFalse(cond, "Button should not be clickable because error message is visible on page.");
we.click();
--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/X1GcQrZ53Bk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/27c9582b-5c12-4774-acce-aec5444299f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.