int MaxRetries = 5
Do
Delay 3 seconds
MaxRetries = MaxRetries - 1
While Not File.Exist("file") and MaxRetries >= 0
if(MaxRetries <= 0) then
Abort
Move File "file"
For i.e: Firefox when you start download file is created but size is 0 KB, so maybe you can check if size of file is larger than 0 and then move it. If still 0 wait and retry.
For IE: file with “partial” at the end is created, so you can check file extension Path.GetExtension Method, when extension changed to normal (any other/no longer “partial”) name it is downloaded and read to move.
Hi buddy @Sami_Syed
Once the file is downloaded with a activity to the folder use a activity next to that called PATH EXISTS…
and mention the file path in this activity as input and we will be getting a boolean value as output b variable named out_boolean whether the file exists in that path or not…
– after this path exist activity use a if condition and mention this variable out_boolean in the condition like this
out_boolean=True
If this condition gets passed it denotes that your file exists and can continue further…in the THEN part of if condition
Or if it gives false it will go to ELSE part where you can mention these activities within else part of if condition in order
Delay activity with some time set to it
Then again use a if condition and pass the same boolean output variable and check…it pass (hopefully it should )…then we can continue now with the next step of activities…
This will work for sure
Kindly try this and let know whether this works or not buddy
Cheeers @Sami_Syed
There are two approaches I would suggest in this case.
Check if the file already exists prior to downloading, so you can skip all those steps and perform the process quicker.
,OR
Delete the file prior to downloading so it doesn’t already exist.
Also, I suggest using a Retry Scope rather than Do While. It has timeout built-in so you don’t need so much logic with it. Just rename the Retry Scope to something like “Retry - Wait for File” and use a Path Exist activity or Is True with condition File.Exists(path) in the condition section. And, set the delay to 1 second with a retry number of how many seconds you would like to wait for the file for. If the file never downloads, it will throw an error showing this activity as the source, and perform a retry on it.