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.

Function to fetch the value from Excel

rajathummalarajathummala Members
edited November -1 in Sahi - Open Source
Hi,

I have prepared function to fetch the value from Excel. Please have a look at the below code.

function DataStream_InputFromExcel($StrExcelPath, $Sheetname, $ColumnName){
var db = _getDB("sun.jdbc.odbc.JdbcOdbcDriver", "jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)}; DBQ=$StrExcelPath ;readOnly=false", "", "");
var $SH="$Sheetname" + "$";
var $rs =db.select("select * from"+ [$SH]);
for(var $i=0;$i<=$rs.length-1;$i++){
var $row = $rs[$i];
var $t1 = $row[$ColumnName];
return $t1;
}
}

When i call the above function sahi throws a error saying that provided sheet and path could not found.

Please help me to resolve it.

Thanking in welll advance...


Regards
Raja

Comments

Sign In or Register to comment.