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.
Calling Batch file from sahi
Hi All,
Iam trying to call a batch file by the below given syntex in sahi :
_execute("C:/Documents and Settings/Anjani/sahi_New/userdata/scripts/a.bat");
i have tried :
_execute("C:\\Documents and Settings\\Anjani\\sahi_New\\userdata\\scripts\\a.bat");
in both of the cases iam getting message in sahi as :
--Stopped Playback: SUCCESS--
But nothing happenes and the batch file does not gets executed.
Please help.
Thanks and Regards,
Aakash
Iam trying to call a batch file by the below given syntex in sahi :
_execute("C:/Documents and Settings/Anjani/sahi_New/userdata/scripts/a.bat");
i have tried :
_execute("C:\\Documents and Settings\\Anjani\\sahi_New\\userdata\\scripts\\a.bat");
in both of the cases iam getting message in sahi as :
--Stopped Playback: SUCCESS--
But nothing happenes and the batch file does not gets executed.
Please help.
Thanks and Regards,
Aakash
Comments
I am running a batch correctly so:
_execute("C:\\sahi\\userdata\\bin\\start_app.bat");
good luck
Thanks for your reply.I have checked the path but still i am facing the same issue.
I am still not able to run the bat file with the above command in the posted query.
The path of bat file is correct and the syntax too but the bat file does not run as iam calling ax exe from the batch file and noting happenes.
While running the batch file manually it is getting executed perfectelly.
Iam using sahi 3.5 OS on windows xp.
Please Help.
Thanks and Regards,
Aakash
Kindly help.
my system is:
Win 7 (x64)
Sahi OS 3.5
Chrome
Enclosed is my full function where the _Execute use twice. One to call AutoIt and another to call a. Bat.
good Luck
function start(){
try{
_execute("C:\\Program Files (x86)\\AutoIt3\\AutoIt3.exe C:\\1.au3");
var $contents = _readFile("C:\\sahi\\userdata\\config\\database.txt");
_setGlobal("RutaDB", $contents);
var $rs=ConectarMysql("1","");
VarGlobal();//carga variables globales de BD
for (var $i=0; $i < $rs.length; $i++){
if($rs[$i]["Ctr_Estado"] == "1"){
FileObjects();//OAC
Keyword_Driver($rs[$i]);
}
}
_execute("C:\\sahi\\userdata\\bin\\start_app.bat");
}catch(e){
_logExceptionAsFailure(e);
}
}
Example :
_log(_execute("C:\\file\\path\\runthis.bat ", true));
OR for bat file with parameter:
_log(_execute("C:\\file\\path\\runthis.bat " + $parameter1 + " "+ $parameter2, true));