How can I create my own retry mechanism?

Hello everyone,
The scenario is : I have to download files from different website. I have not assign any try catch block. But what I want to do is : if any error arises while downloading files (any exceptions) I would like to retry the process again.

Reframe work is better suitable when I already have data and need to process to some website.

But in my case, I only have to download files from different websites and save.

How can I add retry mechanism for this ?

To create an own retry mechanism, you can use state machine, a variable has max_retry number and current_retry counter.
Your state code will run until current_retry counter exceeds max_retry and don’t forget to increase current_retry by 1.

You can try global exception handler - I guess it fit for your requirement or
did you tried this thru modern UI approach? say you click download button/link in website, using click activity -add verification context you can indicate element to validate the download success if not it will retry endless till the timeout reached. you may have to add some logic to handle the exception. you can use app state to achieve it.

Regards,
Balram

@Prabin_Chand

If this is complete process then here also you can use re framework and use maxretry number from the config and it would still retry…your transactionitem would be the url for your websites…so for each site it repeats

Or you can as well use retry scope which is mean again for same purpose to retry if anything fails

Hope this helps

Cheers