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.
Need to pass dynamic values to _include() method
HI,
I have a challenge in passing dynamic values to _include() method.
The scenario is:
I have to pass file path/file from a excel sheet. I am able to read the values to _include() method but the method do not execute it.
My code is :
// Read valuees from excel sheet
$rs=db.select("select * from [Sheet1$]");
_alert("Connected to database");
for(var $i=0; $i<$rs.length;$i++)
{
var $row = $rs[$i];
if($row[2]=="yes")
{
$ab=$row["keyword"];
_alert($ab);
_include($ab);
}
}
***************************************
The complete path is defined in the excel sheet row, based on the that it should execute but that is not happening.
Could anyone help me on this.
Thanks,
Sarathy CR
I have a challenge in passing dynamic values to _include() method.
The scenario is:
I have to pass file path/file from a excel sheet. I am able to read the values to _include() method but the method do not execute it.
My code is :
// Read valuees from excel sheet
$rs=db.select("select * from [Sheet1$]");
_alert("Connected to database");
for(var $i=0; $i<$rs.length;$i++)
{
var $row = $rs[$i];
if($row[2]=="yes")
{
$ab=$row["keyword"];
_alert($ab);
_include($ab);
}
}
***************************************
The complete path is defined in the excel sheet row, based on the that it should execute but that is not happening.
Could anyone help me on this.
Thanks,
Sarathy CR
Best Answers
-
Bravo Sarathy,
I too was facing similar problem. never know of _dynamicInclude API.
Just checked if its working and yes, works beautifully.
_dynamicInclude($login + "SAHI_Installer/Supports/Logins.sah");
^ worked perfectly.
Thanks again Sarathy,
Sreekanth.
Answers
The code is as follows:
// Read valuees from excel sheet
$rs=db.select("select * from [Sheet1$]");
for(var $i=0; $i<$rs.length;$i++)
{
_alert($rs.length);
var $row = $rs[$i];
if($row[2]=="yes")
{
__dynamicInclude($row["keyword"]);
}
}
I am using Sahi Pro trail version 4.5.2 (2013-02-05) build.
Thanks,
Sarathy
Version : V4.3
Build : 2013-02-06.
_dynamicInclude API is not shown in "APIs List:" of controller.
but its there when api's are taken from NotePad++.