Need to download file in using Truclient and need to save in Local folder path

Hi team,

We have a scenario where file need to download and store into a path every time.

and when we try to access application flow manually we able  download file store it in C drive Download in Local. Same way, we need to download and need see once execution completed.

Can anyone have idea on this?



  • Verified Answer

    Use this string to write a file to the default download location:   Utils getEnv("USERPROFILE*) +"\\Downloads\\TruclientDownloads\\0\\filename.txt";

    The zero "0" folder is the default in Truclient...but it's important to remember that VuGen automatically cleans up after itself (you cannot change this) so all of your downloaded files are deleted when the script ends.  My solution is to run a PowerShell script that scoops up my downloaded files and moves them to a different folder (I add a "save" folder under the default "0" folder) but there are many other options.  I'm no expert and someone else will likely have a more elegant solution.

  • Hi  ,

    Starting from version 2021 R2, TruClient added a new step type, Wait for File Download. This step ends once file download is done. You can deal with downloaded file with suggestion from Mark once "Wait for File Download" step ends.

  • Hi Alex, 

    Do you have any idea to get the File Size and Duration its for Download a file in Truclient Protocal. If please provide me the code for Download file size and duration.

    I am using this filedownloadResults varible to store file value and  using this "Java script code " as

    Code in Eval Java script TC.log("download file: "+ fileDownloadResult.file +", download duration :" + fileDownloadResult.duration + "seconds", ""standard");

    Correct me if any this wrong in this code 

  • Hi Varshini,

    Your code looks good. fileDownloadResult.file is file path, while fileDownloadResult.duration is duration in seconds.

    Currently file size is not provided. This could be a good enhancement candidate for future releases.