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.

hwo to import .csv file

edited November -1 in Sahi - Open Source
Hi
M trying to import file , i checked other posts related to it nd i tried all of them
bt its taking blank file and showing " import successful" in console.
M using this code

data = data+"05janCu.csv";
String csv="csv";
browser.setFile(elementStub, data);
browser.execute("_sahi._call("+elementStub+".type = "+csv+")");
browser.setValue(elementStub, data);
elementStub.click();
here elementstub=_sahi._file("theFile")
and data = D:/QARun/Input/Reusable Scripts/Import Files\05janCu.csv

please suggest me , its urgent for me

Comments

  • narayannarayan Administrators
    Hi Sudhir,

    Use

    D:/QARun/Input/Reusable Scripts/Import Files/05janCu.csv

    instead of

    D:/QARun/Input/Reusable Scripts/Import Files\05janCu.csv

    Why are you setting the type to csv and then setting its value? Are there any validations on that field?

    Regards,
    Narayan
  • Hi Narayan,
    There r valiations on textfield,
    it should be in .csv format,
    bt the thing is ..
    i have tried " D:/QARun/Input/Reusable Scripts/Import Files/05janCu.csv" ..
    console is showin success..bt its not showing ny response on screen,
    so how i wil come to knw tat whether its taking a blank file or its really uploading some file..!!
  • narayannarayan Administrators
    Really depends on what your application does when you upload a file. Even when you use Sahi, it should behave exactly the way the application would have behaved. If it is showing a blank screen instead of a response, it means the file upload has failed.

    Are there any errors on Sahi's console? (Console means where start_sahi.bat is running) What is visible on the Controller?

    If you can email the html file (which has that form field) to support@sahi.co.in from your official id, we can look at it deeper and help you.

    Regards,
    Narayan
Sign In or Register to comment.