I want to save a file as it is coming with its default name. And i don’t know the file name as it keeps on changing its name. We have just automated to click on the download link.
So once we click on the download link a Save As window appears. So as we don’t know the file name what should we give in the file name field. We are using Type into activity to type the full path of the file.
Where Path has Value such as : “D:\Sample”
NameofFile can be : AnyName eg. “InputData.xlsx” - To make this Name Dymanic Append Time to the FileName annd then append with .xlsx
usually if that gives us a filename be default, but saves in different folder then we can do one thing
–lets get the default filename alone from that field and then concatenate with the filepath we have
–steps involved will be like this
–once after the save as window opens click onthe filepath file which will be having the default value
–use send hot key activity with key as ctrl+a so that it will select the default filename
–then again send hot key activity with key as ctrl+c so that it will copy to clipboard
–now use a GET FROM CLIPBOARD activity and get the value stored in clipboard with a string variable named str_filename
–then use a type into activity and mention the filepath like this “yourfolderpath\”+str_filename.ToString
or
if the save us window doesnt show us the default file name
then we can give our own file name with timestamp like this “yourfolderpath\”+Now.ToString(“dd_MM_yyyy_hh_ss”)+“.xlsx”
here i have mentioned .xlsx you can change as per your filetype