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 Image
Hi,
I am not able to upload Image through Sahi. I tried all suggestion which are posted, but no luck.. Is there anyother way to upload Image file. Itried below code-_setFile(_file("attachmentPhoto"),"C:\\Data\\Candidate_1.jpg");
_call(_file("filename").type = "text"); //here change file type to 'text'
_setValue(_textbox("attachmentPhoto"), "C:\\Data\\Candidate_1.jpg");
_click(_button("Upload"));
but getting messahe "Please select File" file is not uploaded, even itried to pass third parameter, no luck
I am not able to upload Image through Sahi. I tried all suggestion which are posted, but no luck.. Is there anyother way to upload Image file. Itried below code-_setFile(_file("attachmentPhoto"),"C:\\Data\\Candidate_1.jpg");
_call(_file("filename").type = "text"); //here change file type to 'text'
_setValue(_textbox("attachmentPhoto"), "C:\\Data\\Candidate_1.jpg");
_click(_button("Upload"));
but getting messahe "Please select File" file is not uploaded, even itried to pass third parameter, no luck
Answers
Is your site in public so, we can test your code where it went wrong?
Thanks.
Try giving your path like "C:/Data/Candidate_1.jpg"
SAMPLE SCRIPT:-
_navigateTo("http://www.imagetoo.com/"
_setFile(_file("fileup"), "C:/Documents and Settings/umashankar/Watch_Mailbox.JPG");
_setValue(_file("fileup"), "C:/Documents and Settings/umashankar/Watch_Mailbox.JPG");
_click(_imageSubmitButton("subir"));
For more detail:-
Refer:- http://sahi.co.in/w/_setfile
Please do let me know if you have any questions.
Good Luck!!