Support Portal

for ProcessRobot and WinAutomation

Start a new topic

Wait for a file to be downloaded

ADMIN

The attached example demonstrates a way to wait for a file to be downloaded on the Downloads folder.

waj

The logic is broken and the example doesn't work as expected - it goes into endless loop.


I recon that the idea is to monitor the file count and file size (of a single file) and if these values doesn't change then the file is done "downloading".

ADMIN

Hello Rasmus, the example checks the number of files and the size of the most recent file. It is recommended for cases where only one file is downloaded at the same time and its name is not known beforehand. In case the file name is known, there is the 'Wait for File' action that does the trick.

What would happen if you a 'Wait for File' action when downloading a file you know the file name of, however for some reason the file never downloads? would WinAutomation hang at this stage waiting forever for a file to never appear? - as I am not sure what would happen, at the moment I have used the 'Continue Anyway' tick box and set it to 300 seconds (5 mins) and then check if it exists or not by using the 'If File Exists' - set to does not exist - if it does exist, it downloaded correctly and moves out of the if block, if it doesn't exist, then I use a 'Add Item To List' action and add "file not downloaded" to an exception list variable:.%ExceptionList%. and then call a function I use to exit the robot - which counts the number of exceptions in the list, if it is > 0 then it will safely close all applications and send an email with the exception details.


Anyone else got any other suggestions?

Login or Signup to post a comment