Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check page title in selenide

Tags:

java

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");
like image 999
Alex.K. Avatar asked Nov 25 '25 12:11

Alex.K.


2 Answers

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

$("title").shouldHave(attribute("text", "Your page title"));
like image 154
Alex.K. Avatar answered Nov 28 '25 01:11

Alex.K.


Use Selenide.title() method to get page title text

like image 36
Domadin Avatar answered Nov 28 '25 01:11

Domadin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!