I am trying to check the status of <td> element which has status change from "Running" to "Success". 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.
Running
<tbody id="workflows">
<tr id="row8ff2244a64f3e7180164ff637c574d24" class="selected">
<td><span class="wf-status running" id="status8ff2244a64f3e7180164ff637c574d24">Running</span></td>
<td>Copy of Discovery v4madhu-test3-automate</td>
<td>03 Aug 16:14</td>
<td>autotest</td>
<td>dmatarget14.hpeswlab.net</td>
<td></td>
<td></td>
</tr>
</tbody>
Success
<tbody id="workflows">
<tr id="row8ff2244a64f3e7180164ff637c574d24" class="selected">
<td><span class="wf-status wfsuccess" id="status8ff2244a64f3e7180164ff637c574d24">Success</span></td>
<td>Copy of Discovery v4madhu-test3-automate</td>
<td>03 Aug 16:14</td>
<td>autotest</td>
<td>dmatarget14.hpeswlab.net</td>
<td></td>
<td></td>
</tr>
</tbody>
sample 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() > maxtime:
raise Exception