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.

How to capture data from excel sheet and export in to browser.

gunjangunjan Members
edited November -1 in Sahi - Open Source
Hi, my name is gunjan
I am using windows7,sahi V3.5 and Browser Fire fox

My excel sheet is
First Second Total
2 3 5
4 5 9
1 3 4


Can u help me how to capture data from excel sheet and export in to browser
Can u plz tell me how to write the script?



Thank,
Gunjan.

Comments

  • Hi gunjan,

    The Data Driven Testing with excel sheet is explained in the below link.

    http://sahi.co.in/w/working-with-excel-sheets

    ForEg:
    function login($uname, $pwd)
    {
    _setValue(_textbox("user"), $uname);
    _setValue(_password("password"), $pwd);
    _click(_submit("Login"));
    }
    var db = _getDB("sun.jdbc.odbc.JdbcOdbcDriver", "jdbc:odbc:Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=D:\\myfolder\\sample.xls;readOnly=false", "", "");
    $rs = db.select("select * from [Sheet1$]");
    login($rs[0]["uname"], $rs[0]["password"]);
    

    captures the data from sample.xls file and use the values in browser.

    Regards
    Theeran.
  • Hi

    Thank u so much for your suggestion. Now i am capture data from excel sheet and export in to browser.



    Thanks,
    Gunjan.
This discussion has been closed.