aqFileSystem.Exists: Is there a way to add wildcard characters in the filename?
Hi,
After I click on Download Excel button present in my application., I have a function that has to wait until download finishes using "aqFileSystem.Exists(filenameWithPath)" as a check. The download file gets downloaded in my Download folder. Let's say my file name is ReportName
So, my code looks something like this:
aqFileSystem.Exists("C:\\Users\\test\\Downloads\\ReportName.xlsx");
The above code works fine only 1st time ReportName gets downloaded. What if I run my script again and the file downloads? It actually appends (1) and then next time again (2) and so to the filename. So it becomes ReportName (1).xlsx , ReportName (2).xlsx and so on. So in this scenario above code will fail.
To avoid the above issue, I tried doing this (hoping wildcard character match works):
aqFileSystem.Exists("C:\\Users\\test\\Downloads\\ReportName*.xlsx");
But it didn't work. It returns false, although the file is downloaded and present in the path.
Please help.