While loop don't find the value

Hello everybody,

I was reviewing my while loop, and though about something, if the loop finish a web table which it’s looping and don’t find the check box which i has to find a check it. how to make an exception, like when it will occur this issue, it sends an email to the person in charge.

The think is that this loop works on a web table, which it should loop the table untel it finds the value needed, than check it, if not it’s keeps looping untel it find to check it. Normaly that’s what should happen, but this process has people working on it too, so they the same job as the robot. So my question if the loop finds it self with this issue. What should i do ?

Thank you

In theory you should do something like this

while {
if row has the checkbox to check
check it and break
} condition: end of rows

Hope this helps

Hi @fsilva

Thanks the response!

The loop works fine, i can loop untel i find the checkbox to check it. But it’s occured to me that it’s possible that the loop never finds that value… here i don’t know what to do?! an exception ?

Hi,
You can have a counter variable to check how many times the loop has to run.

Let us know if this helps.
Regards,
Pavan H

Hi @pavanh003

I can’t know how many times the loop can go, because it’s a dynamic website which can change every 30sc

Hi,
If you are just looking for a perticular element to exists in the window, you can try with element exists and need not to use any loop,
->if you try with element exists: timeout value in property to 30000(30 sec),
->wait for property as interactive,
->try in decision and see if element exists and based on result go ahead with next steps,

let us know if this helps,
Regards,
Pavan H

in your case you can use the activity Find Children to know how many rows you got each time the site refreshs.

Hi, the loop works fine, but in some case i can find that the check box has been already checked by a humain, and the table shows only the unchecked values… the idea is that when the loop don’t find the value and no more pages to search on them instead of stoping and telling me error, send a kind of mail or something.

Hey,
In that case you can check for element exists inside the loop and if the element exists, continue or else break and this will come out of the loop if there are no more check boxes as per your requirement.

Let us know if this helps,
Regards,
Pavan H

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