javaselenide

How to check page title in selenide


How to check page title in Selenide using shouldHave assertion?

In 'Selenium' it will be the next code:

Assert.assertEquals(title(), "Your page title");

Solution

  • I didn't find any code samples in documentation, but the next code solved my problem:

    $("title").shouldHave(attribute("text", "Your page title"));