title: Checking if element is present using 'By' from Selenium Webdriver and Python
body: <p>I am attempting to validate that text is present on a page. Validating an element by <em>ID</em> is simple enough, buy trying to do it with text isn't working right. And, I can not locate the correct attribute for <em>By</em> to validate text on a webpage.</p>
  
  <p>Example that works for ID using <em>By</em> attribute</p>
  
  <pre><code>self.assertTrue(self.is_element_present(By.ID, "FOO"))
  </code></pre>
  
  <p>Example I am trying to use (doesn't work) for text using <em>By</em> attribute</p>
  
  <pre><code>self.assertTrue(self.is_element_present(By.TEXT, "BAR"))
  </code></pre>
  
  <p>I've tried these as well, with *error (below)</p>
  
  <pre><code>self.assertTrue(self.is_text_present("FOO"))
  </code></pre>
  
  <p>and</p>
  
  <pre><code>self.assertTrue(self.driver.is_text_present("FOO"))
  </code></pre>
  
  <p>*error: AttributeError: 'WebDriver' object has no attribute 'is_element_present'</p>
  
  <p>I have the same issue when trying to validate <code>By.Image</code> as well. </p>