Get Text fails for one table row while working for all other rows(BotsDNA website----Active Loans)

I am working on a UiPath automation that extracts STATUS and PAN NUMBER from an HTML table on the BotsDNA Active Loans webpage.

I am using a For Each Row in Data Table loop. For every iteration, the current Loan Code/account value from Excel is stored in str_4_num.

I have two Get Text activities:

  • One Get Text extracts the STATUS.
  • The other Get Text extracts the PAN NUMBER.

Both activities are using an anchor-based targeting approach.

How my selectors are configured

For both Get Text activities:

  • Target: Fuzzy selector
  • Anchor: Strict selector

The dynamic variable is used in the Anchor, not in the Target.

The Strict Anchor identifies the Loan Code of the current iteration using str_4_num, for example:


<webctrl tag='TABLE' />
<webctrl tag='A' aaname='{{str_4_num}}' colName='LOAN CODE' />

So, if the current Excel value is a particular Loan Code, the anchor dynamically finds that Loan Code in the table.

The Target then identifies the corresponding STATUS or PAN NUMBER cell relative to that anchored Loan Code row.

I am deliberately not hardcoding tableRow or idx, because the row position can change and I want the automation to work dynamically for any number/order of accounts.

The problem

The automation works for some rows, but fails for other rows.

The behavior is inconsistent:

  • Sometimes the STATUS Get Text fails while PAN NUMBER works.
  • Sometimes the PAN NUMBER Get Text fails while STATUS works.
  • Sometimes both work correctly.
  • The failure can occur on different rows.

For example, I noticed the issue around account number:


546413542715

However, the PAN NUMBER for the same row can sometimes be extracted successfully while the STATUS fails, which makes me think the issue may be related to how UiPath resolves the target relative to the strict anchor.

I have already tried re-indicating the elements and removing unnecessary idx attributes. I also tested Strict/Fuzzy targeting.

My question

Why would an anchor-based selector with a dynamic Strict Anchor and Fuzzy Target work for some rows but fail for other rows in the same HTML table?

Could the HTML/DOM structure of certain rows be different even though they look identical visually?

What is the recommended way to create a reliable Fuzzy Target + Strict dynamic Anchor for extracting values from the same table row without hardcoding tableRow or idx?

Hi @Showkath_Dharmavaramshaik ,

Yes, this can happen if the HTML/DOM structure of some rows is slightly different, even though the rows look identical in the browser.

Since the dynamic value is being used in the Anchor, I would suggest checking the generated selector for both a working and failing row in UI Explorer. Compare the parent <tr>/<td> structure and attributes between them.

A more reliable approach would be:

  • Keep the Loan Code as the dynamic Strict Anchor.

  • Make sure the anchor is uniquely identifying the correct row.

  • For the Target, use a selector that is relative to the same row rather than relying on a fixed idx or tableRow.

  • Check whether STATUS and PAN cells have consistent attributes such as aaname, colName, or tag.

  • If the table is dynamically loaded, add a short wait/check before Get Text to ensure the row content is available.

I would first compare the DOM structure of one working row and one failing row. If they differ, that would explain why the same selector behaves inconsistently.

Thank you for the detailed response! I really appreciate your help. I’ll compare the working and failing rows in UI Explorer and check the selector structure as you suggested.

hiii @Showkath_Dharmavaramshaik

You’re welcome! :blush: Please check the suggested approach and let us know if it resolves the issue. If the issue is resolved, please mark the appropriate reply as the Solution so that it can help other community members with a similar problem.

If you need any further assistance, feel free to ask here. Happy to help!

Hi @Showkath_Dharmavaramshaik

Since the dynamic Strict Anchor is working, I would suspect the Fuzzy Target. It may be matching different elements for different rows because the HTML structure/attributes are not exactly the same.

I would compare a working and failing row in UI Explorer and make the Target more specific using stable attributes like tag, colName, etc.

Avoid idx and tableRow since the row order is dynamic. If the table structure is consistent, you can also try Extract Table Data, which may be more reliable than separate Get Text activities.

I am working on the BotsDNA – Active Loans website. My requirement is to process the loan details row by row and use the Loan Code as the Anchor to retrieve the corresponding PAN Number from the same row.

The main issue is that the dynamic Anchor is working correctly, but the relationship between the Anchor and the Target is failing.

For example:

  • Loan Code: SAPTHAGIRI GRAMIN BANK-7325
  • PAN Number: DIWPK9815G

I am using an Anchor Base with the following configuration:

Target – PAN Number

The Target is the PAN Number cell in column 3.

We tried using a Strict Target with:


<webctrl tag='TABLE' />
<webctrl isleaf='1' tableCol='3' tag='TD' />

We also tried using a Fuzzy Target.

Anchor – Loan Code

The Anchor is the Loan Code, using a Strict selector, with the Loan Code made dynamic using the variable str_4_num:


<webctrl tag='TABLE' />
<webctrl tag='A' aaname='{{str_4_num}}' colName='LOAN CODE' />

The Anchor itself is working correctly. For every iteration, it identifies the correct Loan Code.

Actual Problem

The problem is that the Target is not following the row identified by the Anchor.

For example, if the dynamic Anchor identifies a Loan Code that is located in the 4th row, the Get Text should retrieve the PAN Number from column 3 of that same 4th row, such as:


DIWPK9815G

Instead, the Get Text retrieves the first cell/value of column 3, regardless of which row the Anchor is located in.

So currently:


Anchor → Loan Code in 4th row
              ↓
        Target relationship fails
              ↓
        Column 3 → First PAN value

The expected behavior is:


Anchor → Loan Code in 4th row
              ↓
        Same row → Column 3
              ↓
        Corresponding PAN Number

Fuzzy Target Behavior

When I use a Fuzzy Target, it initially works and is able to retrieve the PAN Number from the expected row. However, after processing some rows, the Fuzzy Target also starts failing and does not consistently retrieve the PAN Number from the row identified by the Anchor.

This makes Fuzzy Target unreliable for this requirement.

With a Strict Target, the Target consistently resolves to the first cell of column 3, instead of following the Anchor’s row.

Expected Result

If the Anchor dynamically identifies a Loan Code in row 4, the Target should retrieve the PAN Number from column 3 of row 4.

If the Anchor moves to row 10 during another iteration, the Target should automatically retrieve the PAN Number from column 3 of row 10.

Important Constraint

I do not want to use idx or a hardcoded tableRow, because the row position can change during execution.

The solution should be based on the Anchor Base relationship, where the dynamic Loan Code Anchor identifies the row and the PAN Number Target retrieves the value from the same row.

Question

Why is the Anchor Base relationship between the dynamic Strict Anchor and the PAN Target failing?

How can I configure the Target and Anchor inside Anchor Base so that the PAN Number Target always resolves to the same row as the dynamic Loan Code Anchor, rather than selecting the first value of column 3?

Hi @Showkath_Dharmavaramshaik,

Welcome to the community.

As a best practice, instead of extracting each value from Excel and then searching for the corresponding data on the webpage, you can extract the required data into a DataTable once.

You can then loop through the Excel DataTable and filter the required row using LINQ, Filter DataTable or Lookup activity to find the corresponding data.

This approach will reduce the number of UI interactions and will be faster compared to the current approach.

If this solves your issue, please mark the answer as the solution.

Thanks!