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.

Add file

vickeekulkarnivickeekulkarni Members
edited November -1 in Sahi - Open Source
Hi Narayan,

I am Vivek, I am using this Sahi tool for testing the web application.

I have problem, we have option to upload a file in the web site. But Sahi is not recording the operations performed to upload a file from the local disk.

Steps are like -

There is a option called "Add file", when clicked on this button a pop up window appears.

This window has a button called "Browse" to select the file from the disk which file has to be uploaded to the website and is saved in local machine.

While recording no script is being generated for this operation, and while playing back the tools plays back till the pop-up window. But I'm not able to find the script for selecting the file from the local disk and closing up of the window.

Please help me. Please do let me know if you need further information on this.

Thanks in advance.

Thanks & Regards,
Vivek Kulkarni

Comments

  • narayannarayan Administrators
    Hi Vivek,

    Please have a look at _setFile in the documentation. http://sahi.co.in/w/_setFile
    Also have a look at example script in sahi/userdata/scripts/demo/fileUpload.sah
    You can run the script against http://sahi.co.in/demo/

    Regards,
    Narayan
  • Hi Narayanan,

    I am trying to handle the 'File Upload' control window through an application.

    I am not able to succeed.

    Here are the steps:

    - In the application I am working, there is an option for the user to upload a file using HTML's 'File' component.

    - Which in turn calls and opens the 'File Upload' window in Windows OS.

    - When I try to record the file select and go for open option

    -- the file selected I getting attached, but I could not see any code in the script file for the 'File Upload' window and activities performed on the 'File Upload' window.

    Can you please provide more information on the same? And I do also need information regarding the 'File Save As' window.

    In addition to the above, i would also like to have one more information.

    While working on the sahi tool, the browser lan settings are set to port '9999' and configured to 'localhost'.

    But my application is running on a server where it can only accessed when the internet connection is available.

    I was not able to open the application over the internet when sahi tool is under user on the same browser.

    Can you help me out in this regard both to use sahi tool as well as access my application over the internet?


    Nageswara.
  • Narayan,

    Still I am not able capture the window. Still the script is stopping at the point.

    I'm not able get the syntax of _setfile and how can I use it.

    Please help.
Sign In or Register to comment.