com.codeborne.selenide.Condition [src]
Conditions are used in should / shouldNot / waitUntil / waitWhile constructs. We recommend to import corresponding conditions statically to receive all the advantages of readable code:
visible | appear // e.g. $("input").shouldBe(visible) (instead of $("input").shouldBe(Condition.visible))present | exist // conditions to wait for element existence in DOM (it can be still hidden)hidden | disappear | not(visible)readonly // e.g. $("input").shouldBe(readonly)name // e.g. $("input").shouldHave(name("fname"))value // e.g. $("input").shouldHave(value("John"))type // e.g. $("#input").shouldHave(type("checkbox"))id // e.g. $("#input").shouldHave(id("myForm"))empty // e.g. $("h2").shouldBe(empty)attribute(name) // e.g. $("#input").shouldHave(attribute("required"))attribute(name, value) // e.g. $("#list li").shouldHave(attribute("class", "active checked"))cssClass(String) // e.g. $("#list li").shouldHave(cssClass("checked"))focusedenableddisabledselectedmatchText(String regex)text(String substring)exactText(String wholeText)textCaseSensitive(String substring)exactTextCaseSensitive(String wholeText)andornot
You can build composite conditions like this:
Any condition can be negated:
You can build a custom condition by extending the com.codeborne.selenide.Condition class, like this:
Last updated
Was this helpful?