title: How to wait and get the status of web element using selenium webdriver and python
body: <p>I am trying to check the status of <code>&lt;td&gt;</code> element which has status change from <code>"Running"</code> to <code>"Success"</code>. The status change might take around 1 minute or for every few seconds i need to retry checking the status of  element. Can someone help me how to achieve this , following is the html structure and snippet that i am trying.</p>
  
  <p>Running </p>
  
  <pre><code>&lt;tbody id="workflows"&gt;
  &lt;tr id="row8ff2244a64f3e7180164ff637c574d24" class="selected"&gt;
  &lt;td&gt;&lt;span class="wf-status running" id="status8ff2244a64f3e7180164ff637c574d24"&gt;Running&lt;/span&gt;&lt;/td&gt;
  &lt;td&gt;Copy of Discovery v4madhu-test3-automate&lt;/td&gt;
  &lt;td&gt;03 Aug 16:14&lt;/td&gt;
  &lt;td&gt;autotest&lt;/td&gt;
  &lt;td&gt;dmatarget14.hpeswlab.net&lt;/td&gt;
  &lt;td&gt;&lt;/td&gt;
  &lt;td&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/tbody&gt;
  </code></pre>
  
  <p>Success </p>
  
  <pre><code>&lt;tbody id="workflows"&gt;
  &lt;tr id="row8ff2244a64f3e7180164ff637c574d24" class="selected"&gt;
  &lt;td&gt;&lt;span class="wf-status wfsuccess" id="status8ff2244a64f3e7180164ff637c574d24"&gt;Success&lt;/span&gt;&lt;/td&gt;
  &lt;td&gt;Copy of Discovery v4madhu-test3-automate&lt;/td&gt;
  &lt;td&gt;03 Aug 16:14&lt;/td&gt;
  &lt;td&gt;autotest&lt;/td&gt;
  &lt;td&gt;dmatarget14.hpeswlab.net&lt;/td&gt;
  &lt;td&gt;&lt;/td&gt;
  &lt;td&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/tbody&gt;
  </code></pre>
  
  <p>sample code</p>
  
  <pre><code>timeout = 60
  maxtime = time.time() + timeout
  result = None
  while result is "SUCCESS":
      try:
          # connect
          result = driver.find_element_by_xpath('//td[contains,"dmatarget14.hpeswlab.net"] and td[contains,"Success"]/ancestor::tr')
          time.sleep(5)
      except:
          if time.time() &gt; maxtime:
              raise Exception
  </code></pre>