Skip to main content

 

 

Hi have to click on Ok button , which leads to download a file in excel format in specific folder, how can i validate if the file download completed or not. 

and how to retry if it fails, is there any activity similar to wait for download  like in uipath.

 

Hi ​@Harika 1170,

this would be a basic one:

 

If you know the filename already you don’t need the *.xlsx in IF statement.

Change x times loop and IF statement seconds to your needs.

You could also create a better one and have it as a central task bot with Input variables like DownloadPath, Filename, SecondsToWait and NumberOfIterations or what ever you need. With this approach you can trigger this bot within all you projects where you need to wait for downloads. 

 

Cheers

Marc


@Harika 1170 , you can use a while loop to check IF file exists or not and basis that you can process further


@Harika 1170 , 

Try below might helpful

           $RetryCount$ = 0
           $MaxRetries$ = 3
           Loop While $RetryCount$ < $MaxRetries$
               If File Exists "C:\Downloads\Report.xlsx"
                     Break Loop // File found, exit retry loop
               Else
                     Delay: 5 seconds // Wait for download to start
                     $RetryCount$ = $RetryCount$ + 1
               End If
           End Loop
           If $RetryCount$ = $MaxRetries$
               Log to File: "Download failed after max retries"
               // Handle failure (e.g., throw error, stop bot)

 

If the download fails after all retries, use the “Log to File” action to log the failure, or the “Throw” action to raise an error:

      Throw: "Failed to download Excel file after retries"

 Recommendation: You can pass  $MaxRetries$ from config file

 

Connect here again if you need any help


Reply