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