I have the following HTML code:
<table>
<tbody>
<tr>
<th class="colhead" nowrap="nowrap">Update</th>
<th class="colhead" nowrap="nowrap">Card No</th>
</tr>
<tr>
<td nowrap="nowrap"><a href="/admin?cpm_id=1043">
Update</a></td>
<td nowrap="nowrap">4987 6543 2109 8769</td>
</tr>
<tr>
<td nowrap="nowrap"><a href="/admin?cpm_id=905">
Update</a></td>
<td nowrap="nowrap">5123 4567 8901 2346</td>
</tr>
</tbody>
My question is if I know the value of the 'Card No' element, how can I get the XPath of the Update link? For example, If I know the Card No is "5123 4567 8901 2346", how can I get the XPath of the link element "<a href="/admin?cpm_id=905">"?
Update from comments
I'm using an automation test tool called QTP. I need to get the XPath of the update link element to identify it on the webpage based on the value of the Credit Card number. What I'm after is to get the XPath such as"/html/body/table/tbody/tr[3]/td[1]/a". However, this is the static path of the update link element. I would like to be able to get the XPath based on a Credit Card number.