18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
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.
fetching value from multiple sheets of excel during different iteratio
Hi ,
i m facing problem in fetching values from different sheets of same excel file at different iterations ,
my code is like as fallows,
var $db = _getDB("sun.jdbc.odbc.JdbcOdbcDriver", "jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=C://Users//shreedhar.athani//sahi_pro//userdata//scripts//data_for_fetchvalue_by_2_sheets.xls;readOnly=false", "", "");
for(var $i=1;$i<4;$i++)
{
var $tc="Sheet"+$i;
_alert($tc);
$rs = $db.select("select * from [$tc$]");
//$rs = $db.select("select * from [testcase1$]");
for(var $x=0;$x<$rs.length;$x++)
{
_alert($x);
var $un = $rs[$x]["UN"];
var $pwd = $rs[$x]["PWD"];
here that $tc value is not passing in $rs = $db.select("select * from [$tc$]");
please help me in this regard.
thank you in advance,
Shreedhar.athani
i m facing problem in fetching values from different sheets of same excel file at different iterations ,
my code is like as fallows,
var $db = _getDB("sun.jdbc.odbc.JdbcOdbcDriver", "jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=C://Users//shreedhar.athani//sahi_pro//userdata//scripts//data_for_fetchvalue_by_2_sheets.xls;readOnly=false", "", "");
for(var $i=1;$i<4;$i++)
{
var $tc="Sheet"+$i;
_alert($tc);
$rs = $db.select("select * from [$tc$]");
//$rs = $db.select("select * from [testcase1$]");
for(var $x=0;$x<$rs.length;$x++)
{
_alert($x);
var $un = $rs[$x]["UN"];
var $pwd = $rs[$x]["PWD"];
here that $tc value is not passing in $rs = $db.select("select * from [$tc$]");
please help me in this regard.
thank you in advance,
Shreedhar.athani
Comments
The path to the excel file can be set using '/' or '\\'.
so the path should be either
C:/Users/shreedhar.athani/sahi_pro/userdata/scripts/data_for_fetchvalue_by_2_sheets.xls;
or
C:\\Users\\shreedhar.athani\\sahi_pro\\userdata\\scripts\\data_for_fetchvalue_by_2_sheets.xls;
and also, please ensure that the filepath and sheet name is specified correctly.
Can you post the error on the Sahi-console.
Regards,
Theeran.