Search code examples
testrigor

How do I grab values from a web table in testrigor


web page i am trying to grab values from

Screenshot of the page i am trying to grab data from is attached for reference.

There are 2 tables on the page, below is the outer html of the table i want to grab the value of "Total" of "You Owe" amount.

I have tried several testRigor commands but they either dont seem to grab the right cell value or they fail. example: grab value from row "Total" and column "You Owe" and save it as "amountOwed"

<table cellpadding="0" cellspacing="0" class="dataTable claimsTable table-rwd tablesaw-stack-collapse tablesaw-stack"
    data-tablesaw-mode="stack" id="table-8305">
    <thead>
        <tr>
            <th>Description/Code (CPT)</th>
            <th>Charge</th>
            <th scope="col">Discount</th>
            <th scope="col">Plan Savings</th>
            <th scope="col">Plan Paid</th>
            <th scope="col">You Owe</th>
        </tr>
    </thead>
    <tbody>

        <tr>
            <td>
                <b class="tablesaw-cell-label">Description/Code (CPT)</b>
                <span class="tablesaw-cell-content">
                    <span class="costDescription">Home Medical Equipment (Rental) (25820)</span>
                    <span class="tablesaw-stack-collapse-more" role="button">Show details</span>
                </span>
            </td>
            <td><b class="tablesaw-cell-label">Charge</b><span class="tablesaw-cell-content">$11.81</span></td>
            <td><b class="tablesaw-cell-label">Discount</b><span class="tablesaw-cell-content">$1.14</span></td>
            <td><b class="tablesaw-cell-label">Plan Savings</b><span class="tablesaw-cell-content">$0.00</span></td>
            <td><b class="tablesaw-cell-label">Plan Paid</b><span class="tablesaw-cell-content">$0.00</span></td>
            <td><b class="tablesaw-cell-label">You Owe</b><span class="tablesaw-cell-content">$0.00</span></td>
        </tr>

        <tr>
            <td>
                <b class="tablesaw-cell-label">Description/Code (CPT)</b>
                <span class="tablesaw-cell-content">
                    <span class="costDescription">Drugs (25370)</span>
                    <span class="tablesaw-stack-collapse-more" role="button">Show details</span>
                </span>
            </td>
            <td><b class="tablesaw-cell-label">Charge</b><span class="tablesaw-cell-content">$8,625.81</span></td>
            <td><b class="tablesaw-cell-label">Discount</b><span class="tablesaw-cell-content">$669.51</span></td>
            <td><b class="tablesaw-cell-label">Plan Savings</b><span class="tablesaw-cell-content">$1,169.18</span></td>
            <td><b class="tablesaw-cell-label">Plan Paid</b><span class="tablesaw-cell-content">$5,048.51</span></td>
            <td><b class="tablesaw-cell-label">You Owe</b><span class="tablesaw-cell-content">$1,069.10</span></td>
        </tr>

        <tr>
            <td>
                <b class="tablesaw-cell-label">Description/Code (CPT)</b><span class="tablesaw-cell-content">
                <span class="costDescription">Hearing (87271)</span>
                    <span class="tablesaw-stack-collapse-more" role="button">Show details</span>
                </span>
            </td>
            <td><b class="tablesaw-cell-label">Charge</b><span class="tablesaw-cell-content">$1,194.10</span></td>
            <td><b class="tablesaw-cell-label">Discount</b><span class="tablesaw-cell-content">$204.22</span></td>
            <td><b class="tablesaw-cell-label">Plan Savings</b><span class="tablesaw-cell-content">$16.37</span></td>
            <td><b class="tablesaw-cell-label">Plan Paid</b><span class="tablesaw-cell-content">$0.00</span></td>
            <td><b class="tablesaw-cell-label">You Owe</b><span class="tablesaw-cell-content">$0.00</span></td>
        </tr>

    </tbody>
    <tfoot>
        <tr>
            <td>
                <b class="tablesaw-cell-label">Description/Code (CPT)</b>
                <span class="tablesaw-cell-content">Total</span>
            </td>
            <td><b class="tablesaw-cell-label">Charge</b><span class="tablesaw-cell-content">$9,831.72</span></td>
            <td><b class="tablesaw-cell-label">Discount</b><span class="tablesaw-cell-content">$874.87</span></td>
            <td><b class="tablesaw-cell-label">Plan Savings</b><span class="tablesaw-cell-content">$1,185.55</span></td>
            <td><b class="tablesaw-cell-label">Plan Paid</b><span class="tablesaw-cell-content">$5,048.51</span></td>
            <td><b class="tablesaw-cell-label">You Owe</b><span class="tablesaw-cell-content">$1,069.10</span></td>
        </tr>
    </tfoot>
</table>

Solution

  • To grab values from a table at a specific Column use the following:

    grab values from "my-table" at first column and save it as "first-column-values"

    To grab values from a table at a specific Row use the following:

    grab values from "my-table" at first row and save it as "first-row-values"