I already have this kind of error, and I still don't know why. What am I doing wrong?
I need to assert true if I get a text in the page source.
So here is my method:
public boolean AssertSearch() {
return driver.getPageSource().contains("Item found");
}
And here is my assert:
assertTrue(buscarnok.validabuscaNOK());
And I keep receiving the message "Assertion Error". I don't know why. If I change the "return driver.getPageSource().contains("Item found");"to driver.findelement(by.id("someID")).isdisplayed();it works fine, so why isn't it working with getpagesource?