Hi All,
Below is the HTML structure of an element present in a webtable. Like that there are many other elements in different rows and columns.
<tr id="avlAndFareForm:trainbtwnstns:2" class="rf-dt-r active-row">
<td id="avlAndFareForm:trainbtwnstns:2:j_idt378" class="rf-dt-c">
<a class="trainNoLink" tabindex="2" href="javascript:trainScheFunc('12509')">12509</a>
</td>
</tr>
I will be writing the xpath for searching that element by using the below, since 12509 will be unique text which I can use to search easily
//a[contains(text(),'12509')]
But now I want to store the attribute value of the "id" (either of row or column) by using the above xpath since the "id" value changes dynamically. So, when I'm running the below script through IDE it is not printing the "id" attribute value
<tr>
<td>storeAttribute</td>
<td>xpath=//a[contains(text(),'12864')]@id</td>
<td>s</td>
</tr>
<tr>
<td>echo</td>
<td>${s}</td>
<td></td>
</tr>
Result:
[info] Executing: |storeAttribute | xpath=//a[contains(text(),'12864')]@id | s |
[info] Executing: |echo | ${s} | |
[info] echo: ${s} [It is not printing the correct value]
Please help me on this.