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.

Not able to fetch data from .csv file.

shatrughanshatrughan Members
edited November -1 in Sahi - Open Source
Hi Narayana,

According to your suggestion:

There are 2 ways you can go about this:
1) Use Excel and work on excel like a database.
Or
2) Save the Excel as a csv file and work on the csv file.

I strongly recommend the second way, for these reasons
1) Excel 2007 seems not to work with the 1st approach.
2) csv files are plain text files and can be checked in to subversion or other source control softwares. Diffs and versioning work meaningfully on them and it is easy to see how and why something was changed by another team member.
3) You can always open a csv file in excel to do further processing if needed.

I have save the excel file as csv file, but when i save the excel file as csv file the extension of file change from (.xls) to (.csv.xlsm).

I have tried to fetch the data from that file but got the message "--Stopped Playback: FAILURE--".


function googlesearch($train)
{
_setValue(_textbox("q"), $train);
_click(_submit("Google Search"));
}

googlesearch("irctc");
_click(_link("IRCTC Online Passenger Reservation Site."));
var $db = _getDB("sun.jdbc.odbc.JdbcOdbcDriver","jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=C:\\sahi_20090304\\sahi\\copy of Book1.csv.xlsm","","");

$rs = $db.select("select * from [Sheet1$]");

_setValue(_textbox("userName"), $rs[1]["NAME"]);

_setValue(_password("password"), $rs[1]["PASSWORD"]);


var $length1 = $rs.length;


for (var $i = 0; $i < $rs.length; $i++)

{
_setValue(_textbox("userName"), $rs[$i]["NAME"]);

_setValue(_password("password"),$rs[$i]["PASSWORD"]);

_click(_submit("Login"));
_click(_link("Log Out"));
_navigateTo("irctc.co.in/");

}

Regards,
Shatrughan
Sign In or Register to comment.