I saw many issues related to my question but I didn’t find a solution.
I would like to know the best technique to wait for the browser to finish the download and proceed to the next activity in a dynamic way.
I’m using Mozilla and I know the name of the file and folder where it will be located.
I tried to use “Path Exists” but by the time the download starts, a file with the same name appears.
I tried to use the file size with the while loop, but the condition is lost when there is no file in the folder and nothing happens.
@Guilas, i think @Anthony_Humphries is right, you can have a while loop checking, like while test.csv.part exists keep iterating, once it no longer exists you stop and move on to the next activity, however you need to have at least a 2 second delay before you check because it might check while the download has not started and obviously the file would not exists then it meets the condition, not sure if i make sense at all.
@Guilas, Here is another thought, if you are downloading documents or images, set Firefox to open the file when finished downloading, and then loop around to check if (for example if you are downloading images, check if your default images viewer selector exists and if it does kill it or close it) and if it doesn’t, loop around again and increment counter, you can set it up in a way that if your counter gets to 50 and element still doesn’t exist it gets out of the loop just to avoid infinite loop in case the download failed.
I have created a custom workflow “WaitForDownloadToComplete” for my use.
You can call it after download is initiated and it waits till file is downloaded.
It accepts an IN argument only i.e “FileFullPath”.
You have to pass full path of file for example “C:\Users\User\Documents\UiPath\IsFileDownloaded\20MB.zip”