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?