Wait for Download: No file detected in "C:\Users\Downloads" during the timeout period (1000 seconds). Increase the timeout if the file takes longer to download or check if the Downloads folder is correct

hello community!

In this process bot is downloading the file’s but sometime there is no files there to download so it clicks on download option and if there is no file that page only gets refreshed…But while downloading one file it clicks on download icon and page gets refreshed and it waits for long time in wait for download.
I get error like this-Wait for Download: No file detected in “C:\Users\Downloads” during the timeout period (1000 seconds). Increase the timeout if the file takes longer to download or check if the Downloads folder is correct.

simply you can try this way : -

  1. Take “Wait for Download” Activity and Click on the download option
    and basically timeout could be 30 seconds (30000 milliseconds), but you can adjust it
    based on your download times.

  2. after the “Wait for Download” activity Next use “File Exists” Activity and check the file exists or not in your specified folder and difault time is 30 sec if you required you can increase

  3. Use an “If” activity to check the result of the “File Exists” activity.
    If the file exists, proceed with your normal processing steps.
    Then
    └── Proceed with normal processing
    Else
    └── If the file does not exist, consider it as a failed download and handle it accordingly. perform any other error-handling actions.

@Priyesh_Shetty1

I may misunderstand your question. But do you say that you try to download a file, but if there is no file, the download component waits for a long time until there is a timeout?

If this is a web page, you can try to check the URL-attribute of the button you try to click. If it’s blank, then you know that there is no file.

Hi @Priyesh_Shetty1

If not work you can try this way

Check URL attribute of the button or link you are trying to click in a d reliable way to determine whether a file download will occur or not
1.After clicking the download button or link, add a “Get Attribute” activity to retrieve the URL attribute of the clicked element.
2.In the “Get Attribute” activity, specify the “href” attribute as the attribute you want to retrieve. This attribute typically holds the URL to which the download link points.
3. Use an “If” activity to check the result of the “Get Attribute” activity.

  • If the URL attribute is not blank, it indicates that a download link is present, and you can proceed with the download and processing steps.
    *If the URL attribute is blank, you can consider that not file to download it .

for reference you can see this : -

@Priyesh_Shetty1

Why are you using wait for downlod when there is no file to downlaod…it is expected behaviour of wait for downlod to throw error when file is not downloded…so please use a if condition to check if the downlaod started/there is a file to dowload and only then use wait for downlod

Hope this helps

Cheers

@Anil_G sometime there are files available sometime there is no files there to available…what will be the best way to avoid error?

Example-Let say if i click on a download icon to download a file sometime there are no file available to download so page get refreshed and there it comes like this Pdf 1.4% ??? Like this it comes if no pdf’s available to download.

@Priyesh_Shetty1

How do you know from the ui that the file is not available?

Do you have an url or a blank page coming etc?

Cheers

@Anil_G its actually a pdf’s iam downloading


It come like this pdf-1.4% ???
So i have taken element exist and if condition to handle it…but in one file bot is getting stucked in wait for download,And iam getting error.

@Priyesh_Shetty1

Can you please show the steps you are doing

cheers

@Anil_G
Steps for this process is
1.Bot is going to BSEindia website.
2.There it is selecting Today-1 date in start date and end date option
3.I have stored the keywords which is provided by user in array of string.
4.In Bse website there is a csv file after selecting start and end date iam downloading that csv input file from there.
5.Bot is reading the csv file and if it found the subject i mean from array it found the subject in csv it will download


I have shared the csv file picture for ur reference.

And i have used 2 loops one for each and another for each row in datatable.
Inside for row i have used if condition


…Inside wait for download activity i have done all the downloading steps.

Use “Find Elelment” activites then “wait attribute” activites with if condition

@Priyesh_Shetty1

Try to use get attribute and get the href field…if file is not present generally href will be empty or will have #

cheers

@Anil_G
I have to click on that pdf i con to download…it does not have href in selector.


@Anil_G because i need to download bluelink annexure file also and pdf also…sometime that bluelink file is not available to download… so inside wait for download i have performed all the required task to download.

@Priyesh_Shetty1

Then use element exists for annexure…as it si hyper link it will be present only when file is there

so when link is present use wait for download else done use it

cheers

@Anil_G should i remove the wait for download for downloading pdf’s?

@Anil_G


No href is there.

@Priyesh_Shetty1

Would that button be present even when no annexure is there?

wait for download should be present only when you download

cheers

@Anil_G yes when there is no annexure link available to download that pdf icon is present.

@Priyesh_Shetty1

After you click on the icon is it directly going to download?

or you do any save and all?

Also from the screenshot i cna see a src attribute…is src empty when there is no file to download?

can you check

cheers

@Anil_G after clicking on pdf icon it ask to save the pdf file and then it gets downloaded.