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.

Is response.getOutputStream().write supported?

beesmanbeesman Members
edited July 2010 in Sahi - Open Source
1)if you enter http://sahi.co.in/static/testsaveas.zip
in IE directly you will got
log
2010/07/21 14:20:19 net.sf.sahi.RemoteRequestProcessor processHttp
info: Calling downloadFile
2010/07/21 14:20:19 net.sf.sahi.RemoteRequestProcessor save
info: Downloading sahi_3a2e182909eb704c7e0ae0602131de172b2d__testsaveas.zip to t
emp directory: F:\Tools\sahi_20100611\userdata\temp\download
2010/07/21 14:20:19 net.sf.sahi.RemoteRequestProcessor downloadFile
info: Setting download_lastFile = testsaveas.zip
2010/07/21 14:20:19 net.sf.sahi.RemoteRequestProcessor downloadFile
info: Session Id: sahi_3a2e182909eb704c7e0ae0602131de172b2d

file is download in %sahi_home%\userdata\temp\download

2)but if you want to download file which is outputed by response.getOutputStream()
you will see pop dialog and got nothing in log


http://www.mkyong.com/struts/struts-download-file-from-website-example/
can't auto download which output like DownloadFileAction

there is nothing download in %sahi_home%\userdata\temp\download

Comments

  • narayannarayan Administrators
    Hi beesman,
    Sahi auto downloads only some content types. You can add more content-types to
    sahi/userdata/config/download_contenttypes.txt
    and restart Sahi to make it download your files.

    For example, you could add the following content-types:

    zip
    excel
    doc
    application/vnd
    application/ms
    application/octet-stream

    Similarly, there is also a download_urls.txt which can be used.

    Regards,
    Narayan
  • beesmanbeesman Members
    edited July 2010
    hi narayan
    i did download the pdf file, thank you for your help!!

    what's the difference between the following files

    %sahi%\userdata\config\download_contenttypes.txt
    %sahi%\config\userdata_template\config\download_contenttypes.txt
  • up
  • narayannarayan Administrators
    Hi Beesman,

    userdata\config is the one you need.

    If you want to create a new userdata directory somewhere, you could copy the userdata_template directory. It has the relavant files. It is not used directly by Sahi.

    Regards,
    Narayan
  • beesmanbeesman Members
    edited August 2010
    I see, thanks
This discussion has been closed.