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.
Nested else-if statements?
Hi, what is the syntax for if-else-if statements in Sahi script? The following failed with a syntax error:
function caseSwitch($htype){
if($htype==22){
type22();
}
else
{if($htype==5){
type5();
}
}
else
{
_log("Whoops, Hierarchy Type " + $htype + " has not been automated yet");
}
}
function caseSwitch($htype){
if($htype==22){
type22();
}
else
{if($htype==5){
type5();
}
}
else
{
_log("Whoops, Hierarchy Type " + $htype + " has not been automated yet");
}
}
Best Answer
-
Hi kyoob,
Please try with the below code,
function caseSwitch($htype)
{
if($htype==22)
{
type22();
}
else if($htype==5)
{
type5();
}
else
{
_log("Whoops, Hierarchy Type " + $htype + " has not been automated yet");
}
}
Good Luck !!
-Umashankar
Answers