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.
Upload file in a primefaces page
GOAL: test uploading files to a fronend page developed with primefaces.
Script sahi (with a standard html form, it works! but in primefaces doesn't work)
_setFile(_file("idform"), "C:\\path\\file.pdf");
_call(_file("idform").type = "text");
_setValue(_textbox("idform"), "C:\\path\\file.pdf");
example form to upload file with primafaces:
<h:form>
<p:fileUpload fileUploadListener="#{fileUploadView.handleFileUpload}" mode="advanced" dragDropSupport="false"
multiple="true" update="messages" sizeLimit="100000" fileLimit="3" allowTypes="/(\.|\/)(pdf)$/" />
<p:growl id="messages" showDetail="true" />
</h:form>
running the script, I see in the page for a short time the file that is loaded (it seems to be loaded) but actually nothing is loaded, because on the backend side (in the spring controller) no file arrives.
Any suggestions?
thanks
Luigi
Script sahi (with a standard html form, it works! but in primefaces doesn't work)
_setFile(_file("idform"), "C:\\path\\file.pdf");
_call(_file("idform").type = "text");
_setValue(_textbox("idform"), "C:\\path\\file.pdf");
example form to upload file with primafaces:
<h:form>
<p:fileUpload fileUploadListener="#{fileUploadView.handleFileUpload}" mode="advanced" dragDropSupport="false"
multiple="true" update="messages" sizeLimit="100000" fileLimit="3" allowTypes="/(\.|\/)(pdf)$/" />
<p:growl id="messages" showDetail="true" />
</h:form>
running the script, I see in the page for a short time the file that is loaded (it seems to be loaded) but actually nothing is loaded, because on the backend side (in the spring controller) no file arrives.
Any suggestions?
thanks
Luigi