Issue with clicking through web site data table to the next row


I have a click text and get text PIN which I output to a variable. The process I have in place has to verify that the PIN in the Get Text matches the data in the dt_verity excel sheet. That works, my issue is that when the bot loops back to the Click TD it clicks the same row in the table (yellow highlighted one) I need it to click the next row? What would be the thing that I’m missing in this set up to achieve this? PINforEACh

Hello,

Can you check the click activity selector attributes for tablerow tag? if you find one you can just get the index value from for each row activity and increment the same or else you can use while loop and increment the count…

Regards

1 Like

Hi

There are two possible ways to achieve this

  1. First if you can extract that table as a data table using DATA SCRAPPING then scrap it and save the output as a data table named dt

Then use a FOR EACH ROW activity where pass the dt as input and inside the loop use a CLICK activity

In that click activity initially click on the first row under the column (org/…)
That is click on that first cell in third column as in picture

Once after indicating that element then open the selector and see what is the value of Aaname and replace that with a variable in selector editor

Now that click activity with a variable in selector is inside the loop and place a assign activity before that click activity and pass the value for that variable we created in selector

So that it will click on each row one by one

  1. Or click on first row in that table and see the selector
    If it has any attribute named table row then increment it by keeping the click activity inside the while loop

Use a while loop with a condition like this

Bool_no = True

Where bool_no is a Boolean variable defined jn variable panel with default value as False

Inside the while loop use a assign activity like this

var_selector = counter

Where var_selector is a string variable created inside the selector editor and replaced the tablerow attribute value

And counter is a int32 variable with default value as 0

Then use the click activity surrounded with TRY CATCH that is only the click activity inside the while is surrounded with try catch and pass the above variable in selector of click activity

If there is no more rows and if click activity fails then it goes to CATCH block where use assign activity like
bool_no =False

Then outside try catch activity where still being inside while loop, use a assign activity again and mention as

Counter = counter + 1

Cheers @jeff.shubzda

1 Like

Wow, your amazing! Thank you so much for the info!!! Back to work now!!! :slight_smile:

1 Like

OK I tried #2 and I’m getting errors, not sure if I did this right? Bit of an amateur with loops :frowning:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.