18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
Verify the file format
Hi ,
I have downloaded a pdf file from my application.
Is there any way to verify the file format is pdf ?
Please help me on this.
I have downloaded a pdf file from my application.
Is there any way to verify the file format is pdf ?
Please help me on this.
Best Answer
-
try using :-
var $filename= _lastDownloadedFileName();
and verify .pdf is present in the filename
Regards,
Bhavitha
Answers
1. downloading the file and saving it in diff. location.
2. after tat i'm verifying the file format.
when fetching teh file name using a variable , its showing as "downloadData" , not the file name which i saved.
Please help me.
Regards,
Sindhu.
_clearLastDownloadedFileName();
var $downloadedFile= _lastDownloadedFileName();
_saveDownloadedAs("D:\\folder\\"+$downloadedFile);
Regards,
Bhavitha
var $downloadedFile= _lastDownloadedFileName();
_saveDownloadedAs("C://Users//lakshmsn//Desktop//SVN//Trackers//Automation//RM//Sprint8//+$downloadedFile");
_clearLastDownloadedFileName();
_assertContainsText("/.*pdf/", $downloadedFile);
_clearLastDownloadedFileName();
var $downloadedFile= _lastDownloadedFileName();
_saveDownloadedAs("C://Users//lakshmsn//Desktop//SVN//Trackers//Automation//RM//Sprint8//+$downloadedFile");
_assertContainsText("/.*pdf/", $downloadedFile);
if the last line script does not work, use substring to fetch ".pdf" and compare
Thanks,
Ashokan.P
It dint work. Its taking file name as 'null' when validating the text.
_assertContainsText("/.*pdf/", null);
Regards,
Sindhu L.
can you verify if actually file is getting downloaded.
The file is available at
",SAHI_INSTALLATION_FOLDER/sahi_pro/config/userdata_template/config"