title: My method to find element by xpath using Contains text in try catch block is returning false
body: <p>I am using Webdriver with Python
  I have a method which checks if the project name on the webpage contains an expected value.<br>
  My method is returning false.  I was expecting it to return true.</p>
  
  <p>I am using the following xpath to check if an element contains the project name</p>
  
  <pre><code>self.driver.find_element_by_xpath ('//*[contains(text(), %s)]' % project_name)
  </code></pre>
  
  <p>E.g. project name value I am looking for is <code>LADEMO_IE_05_21_1510_18_31</code></p>
  
  <p>When i print the xpath the following output is returned in the console &amp; it is 
  there (5th row down).</p>
  
  <pre><code>project_name_element = self.driver.find_element_by_xpath ('//*[contains(text(), %s)]' % project_name)
  
  print project_name_element.text
  </code></pre>
  
  <p>The output is as follows:</p>
  
  <pre><code>JMeter_Reports_MegaOneCC
  
  LAdemo
  
  Sales Demo
  
  Normal
  
  LADEMO_IE_05_21_1510_18_31
  
  LADEMO create a basic project test script - Selenium Webdriver/Python Automated test
  
  LADEMO_IE_05_21_1510_20_44
  </code></pre>
  
  <p>My code snippet is below of the method and the Test Case which calls the method.</p>
  
  <p>From Pages\admin.py</p>
  
  <pre><code>import datetime
  from selenium.common.exceptions import NoSuchElementException
  from Locators.locators import MainPageLocators
  from Locators import locators
  from Locators import element
  from Locators.element import BasePageElement
  from Pages.base import BasePage
  #from Pages.administrationPage import AdministrationPage
  import re
  
  class AdministrationPage(BasePage):
  
  def is_project_text_present2(self, project_name):
          try:
              project_name_element = self.driver.find_element_by_xpath ('//*[contains(text(), %s)]' % project_name)
              print project_name_element.text
          except NoSuchElementException, e:
              return False
          return project_name_element.text in project_name
  </code></pre>
  
  <p>TestCases\AdministrationPage_TestCase.py</p>
  
  <pre><code>import unittest
  import time
  import datetime
  from selenium import webdriver
  from Locators import locators
  from Locators import element
  from Pages import login
  from Pages import admin
  import datetime
  
  class AdministrationPage_TestCase(unittest.TestCase):
  
  def test_add_Project(self):
      print "*** test_add_project ***"
      #this var contains the project name value e.g. LADEMO_IE_05_20_152015 which is then used for project_name_textfield.send_keys(project_name_fieldValue) from the add_project method
      project_name = "LADEMO_IE_" + self.get_datetime_now()
      print "project_name_value" + project_name
      login_page = login.LoginPage(self.driver)
      login_page.userLogin_valid("riaz.ladhani", "pass123")
      administration_page = login_page.clickAdministration()
      administration_page.add_project(project_name)
      try:
          administration_page.is_project_text_present2(project_name)
          print administration_page.is_project_text_present2(project_name) # false is printed here on the console. I want this to be true because the project name text does exist
      except AssertionError as e:
          self.verificationErrors.append(str(e))
      print "I am here in except AssertionError as e: administration_page.is_project_text_present2(project_name)"
  </code></pre>
  
  <p>The output to the console is </p>
  
  <p>False
  I am here in except AssertionError as e: 
  administration_page.is_project_text_present2(project_name)</p>
  
  <p>Is there something incorrect in my method to return false and not true?</p>
  
  <p>The HTML is:</p>
  
  <pre><code>    &lt;table cellspacing="0" style="table-layout: fixed; width: 100%;"&gt;
  &lt;colgroup&gt;
  &lt;tbody&gt;
      &lt;tr class="GAT4PNUFG" __gwt_subrow="0" __gwt_row="0"&gt;
      &lt;tr class="GAT4PNUEH" __gwt_subrow="0" __gwt_row="1"&gt;
      &lt;tr class="GAT4PNUFG" __gwt_subrow="0" __gwt_row="2"&gt;
      &lt;tr class="GAT4PNUEH" __gwt_subrow="0" __gwt_row="3"&gt;
      &lt;tr class="GAT4PNUFG" __gwt_subrow="0" __gwt_row="4"&gt;
      &lt;tr class="GAT4PNUEH" __gwt_subrow="0" __gwt_row="5"&gt;
      &lt;tr class="GAT4PNUFG" __gwt_subrow="0" __gwt_row="6"&gt;
      &lt;tr class="GAT4PNUEH GAT4PNUMG" __gwt_subrow="0" __gwt_row="7"&gt;
      &lt;td class="GAT4PNUEG GAT4PNUFH GAT4PNUHG GAT4PNUNG"&gt;
      &lt;td class="GAT4PNUEG GAT4PNUFH GAT4PNUNG"&gt;
          &lt;div __gwt_cell="cell-gwt-uid-113" style="outline-style:none;"&gt;
              &lt;span class="linkhover" title="LADEMO_IE_05_21_1510_18_31" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;empty-cells:show;display:block;color:#00A;cursor:pointer;"&gt;LADEMO_IE_05_21_1510_18_31&lt;/span&gt;
          &lt;/div&gt;
      &lt;/td&gt;
      &lt;td class="GAT4PNUEG GAT4PNUFH GAT4PNUNG"&gt;
      &lt;td class="GAT4PNUEG GAT4PNUFH GAT4PNUNG"&gt;
      &lt;td class="GAT4PNUEG GAT4PNUFH GAT4PNUBH GAT4PNUNG"&gt;
  &lt;/tr&gt;
  &lt;tr class="GAT4PNUFG" __gwt_subrow="0" __gwt_row="8"&gt;
      &lt;td class="GAT4PNUEG GAT4PNUGG GAT4PNUHG"&gt;
      &lt;td class="GAT4PNUEG GAT4PNUGG"&gt;
          &lt;div __gwt_cell="cell-gwt-uid-113" style="outline-style:none;"&gt;
              &lt;span class="linkhover" title="LADEMO_IE_05_21_1510_20_44" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;empty-cells:show;display:block;color:#00A;cursor:pointer;"&gt;LADEMO_IE_05_21_1510_20_44&lt;/span&gt;
          &lt;/div&gt;
      &lt;/td&gt;
          &lt;td class="GAT4PNUEG GAT4PNUGG"&gt;
         &lt;td class="GAT4PNUEG GAT4PNUGG"&gt;
         &lt;td class="GAT4PNUEG GAT4PNUGG GAT4PNUBH"&gt;
       &lt;/tr&gt;
       &lt;tr class="GAT4PNUEH" __gwt_subrow="0" __gwt_row="9"&gt;
       &lt;tr class="GAT4PNUFG" __gwt_subrow="0" __gwt_row="10"&gt;
       ...
    &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>