determine file name of downloaded file
- 6 years ago
You should be able to use https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/window-and-process/savefile-method-window-object.html when you export / save and specify your path and file name.
Alternatively, you could use https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqfile/methods.html and https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqfilesystem/methods.html to determine the newest file in your download directory.
- 6 years ago
My guess is that it exports/downloads to the default "Downloads" folder for the currently logged in user. So, you can do something like %AppData% to get the pathing to start with.
As for the filename, It might not be a matter of filename, but more on the lines of just detecting the CSV/XLS file with the most recent date/time stamp. Look into using aqFileSystem to determine that.
I would also suggest, in order to make that easier, at the end of the test, delete all CSV/XLS files from that folder or at least move them to an archive place. That way, when you do the export, the ONLY file in that downloads folder will be the one you want... and the specific filename itself won't matter.