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.

_setFile not works

beesmanbeesman Members
edited July 2010 in Sahi - Open Source
SOS_setFile not works

_setFile(_file("file1"), "C:/notify.pdf");
_click(_link("import"));

nothing is output to sahi console
the script is normally executed,

struts action :
protected String process(ActionMapping mapping,ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    FormFile fileUp = (FormFile) form.get("file1");
    //fileUp.getFileSize()  is 0
   //fileUp.getFileName() is ""        
}


i modified the FileUpload.java
public class FileUpload {
    private static Logger logger = Configuration.getLogger("net.sf.sahi.command.FileUpload");

    @SuppressWarnings("unchecked")
    public HttpResponse setFile(final HttpRequest request) {
        logger.info("setFile(final HttpRequest request) in .....");
        ...................
    }

    @SuppressWarnings("unchecked")
    public HttpResponse appendFiles(final HttpRequest request) {
        logger.info("appendFiles(final HttpRequest request) in .....");
        ......................
    }
}



in sahi console

info: setFile(final HttpRequest request) in .....
appendFiles() is not executed, why........

Sahi V3 Release 2010-06-11
IE 8 XP
Struts 1.X

I also tried sahi_20100430

Comments

  • beesmanbeesman Members
    hi narayan!

    SOS
  • narayannarayan Administrators
    SOS! :D

    Hi beesman,

    Can you check if the action (of the form being submitted) changes on clicking import?

    Regards,
    Narayan
  • beesmanbeesman Members
    edited July 2010
    hi Narayan

    i solved the problem, please close this post.

    Thank you all the same.
This discussion has been closed.