How to click the "Detail" button in a web DataTable if a specific column value is greater than 0 (Test Suite scenario)

Hi everyone,

I’m working on a test case in UiPath Test Suite using Studio, and I need help with the following scenario:

I have a web-based DataTable, and each row contains a numeric value (like “Amount”) and a corresponding “Detail” button.

My goal is to click the “Detail” button only for the rows where the “Amount” value is greater than 0.

Here’s what I tried:

I used a For Each Row loop.

Inside the loop, I used an If condition to check if the value is greater than 0.

Then I assigned the rowIndex to a variable using an Assign activity.

I passed this variable into a dynamic selector for the “Detail” button.

But the selector doesn’t find or click the button, even though I’m sure the index and values are correct.

Any idea what might be wrong? Should I change the way I build the selector, or is there a better way to approach this?

Thanks in advance for your help!

@firdevs_turgut

Welcome to the community

use for each ui element and iterate over rows get the values of column for each row and then click on detail of corresponding row…for getting column values from row selector use find children and get the required child to get value and then click

alternately use regex in your selector to find only rows which are greater than 0 baically somr regex like this would help ^[+]?\d+([.]\d+)?$

so your selector looks somethign like this,you need to add idx as well which will server as incrementer so till idx fails you can run loop

<webctrl tag='TD' tablecol='Amount column number' innertext='^[+]?\d+([.]\d+)?$' matching:innertext='regex' idx='counter starting from 1 and increment till no more rows' />
<nav up='1'>
<webctrl tag='TD' tabelcol='Detail button column number' />

cheers

@firdevs_turgut

Welcome to Community!!

Instead giving only index try to modify your selectors by using UiExplorer.
And its better to for each UiElement activity instead of for each row in data table. So that you can easily click respective element based on your condition.

Happy automation!!

Hi @firdevs_turgut
Welcome to UiPath,

I think you can use Find Children to get all rows, loop through them, extract the “Amount” from each row element, and click the “Detail” button if the amount > 0. This avoids relying on fragile indexes.

Also, add delays or check element existence before clicking to ensure the button is ready.

If helpful, mark as solution. Happy automation with UiPath