title: Selenium and Python using If statement
body: <p>I am trying understand why an <code>if else</code> isn't working using Selenium and Python. I have tried several different variations, but I believe this should work and stubbornly, maybe blindly, keep coming back to it.</p>
  
  <p>example:</p>
  
  <pre><code>    if (self.driver.find_element_by_class_name('product')).text == "FEATURED PRODUCTS":
          print "\nHome Pass"
      else:
          print "\nHome Fail"
  </code></pre>
  
  <p>Tried this as well</p>
  
  <pre><code>if self.driver.find_element_by_class_name("product-teaser-list").text in "Featured Products":
  </code></pre>
  
  <p>Each execution returns <code>Fail</code> and when using assert, below, the <code>.text</code> is found. So I know the text is found with this method.</p>
  
  <pre><code>assert "FEATURED PRODUCTS" in self.driver.find_element_by_class_name('product').text
  </code></pre>