verifying if a file is downloaded
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
verifying if a file is downloaded
Hi Team,
On click of download button an excel file is downloaded in my application.
How can I verify whether the file has been downloaded?
Solved! Go to Solution.
- Labels:
-
Web Testing
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can look in the expected location and see if the file exists there using this method
https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqfilesystem/exists.html
Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Marsha,
Thank you so much for providing the solution however it doesn't seems to be working.
For now I have manually saved the file in the path mentioned in spath. I have written below code
function FileExistsExample()
{
var sPath;
sPath = "C:\TestCompleteFileStore\TestCompleteQueries.txt";
if (! aqFileSystem.Exists(sPath))
Log.Message("File is not downloaded")
}
But the if condition is getting true even when the file is present at the specified path.
Could you please correct me if i am wrong?
Also it is possible to download the file at my desired location instead of it getting downloaded in the default Downloads folder?
If yes, please suggest how can we do that as well
Thank you!
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you're following this example
https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqfilesystem/exists.html
then it looks like you are missing a semicolon at the end of the Log.Message line
This may help you put the file where you want it
Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use double backslashes '\\'
function FileExistsExample()
{
if (aqFileSystem.Exists("C:\\Temp\\Book1.xlsx")) {
Log.Message("File exist");
} else {
Log.Message("File does not exist")
}
}
You can change the default download folder location in your browser.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much. It worked for me!!!! 🙂
