How to get the count number under tbody, use xpath in UFT

149 Views Asked by At

I am using UFT to write the automation script, I want to to get the count number under one tbody element,(count how many 'tr', and return the result)

<tbody role="rowgroup">
    <tr _calss="01">
    <tr _calss="02">
    <tr _calss="03">
    <tr _calss="04">
    <tr _calss="05">
</tbody>

How to write the code in UFT?

1

There are 1 best solutions below

0
On

Since it is unclear if there can be more than one tbody you could use this for the first one.

count((//tbody)[1]/tr)