18 January 2026:


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.

_lastDownloadFileName() is null or wrong

andregsandregs Members
edited November -1 in Sahi - Open Source
Hi, I'm new at Sahi. It's such a great tool, but I'm facing some problems regarding file downloads.

I have a link to a file, with target="_blank". The link is a direct link to the file. The file is downloaded, but _lastDownloadedFileName() returns null. And here I also have this issue: viewtopic.php?id=1327 (I'm a new member, so I'm not allowed to post links, sorry).
_assertNull(_lastDownloadedFileName()); at 13/04/2011 10:41:11
_click(_link("form[f5_lin_modelo]")); at 13/04/2011 10:41:23
_assertEqual("form-obr-38v01.doc", _lastDownloadedFileName());
Assertion Failed.
Expected:[form-obr-38v01.doc]
Actual:[null]
at assertDownloadLink (D:\\processos\\teste\\function\\arquivo.sah:30) at 13/04/2011 10:41:33
_clearLastDownloadedFileName(); at 13/04/2011 10:41:35
_assertNull(_lastDownloadedFileName()); at 13/04/2011 10:41:35

I also have a link to a server script that outputs other file. It is downloaded by Sahi, but the _lastDownloadedFileName() is returning the script name instead of the file name.
_assertNull(_lastDownloadedFileName()); at 13/04/2011 10:41:39
_click(_link("Download")); at 13/04/2011 10:41:39
_assertEqual("arquivo.zip", _lastDownloadedFileName());
Assertion Failed.
Expected:[arquivo.zip]
Actual:[cases_ShowDocument]
at assertDownloadLink (D:\\processos\\teste\\function\\arquivo.sah:30)
at assertDownloadInputDocument (D:\\processos\\teste\\function\\arquivo.sah:39) at 13/04/2011 10:41:51
_clearLastDownloadedFileName(); at 13/04/2011 10:41:53
_assertNull(_lastDownloadedFileName()); at 13/04/2011 10:41:53

Could somebody help me here, please?

Thanks,

André.
Sign In or Register to comment.