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 functions from an Excel sheet
Hi guys.
I have a little question here:
I have an Excel sheet, with two columns:
id function
1 login
2 new item
3 save
4 exit
I've written my Sahi Script to load this sheet and with a LOT OF 'if', to call the function that the Excel sheet told to Sahi.
Example:
As you can see, Sahi will execute the function in the order that I put it in the Excel sheet, even if in the wrong way. If I write in the Excel sheet only:
id function
1 login
2 exit
Sahi will only login in the system and exit it.
The question that I have is, is there anyway to make Sahi to execute the functions that I put in the Excel sheet without using 'if ~ else if' or 'switch case'?
I have a little question here:
I have an Excel sheet, with two columns:
id function
1 login
2 new item
3 save
4 exit
I've written my Sahi Script to load this sheet and with a LOT OF 'if', to call the function that the Excel sheet told to Sahi.
Example:
var $rs = db.select("select * from [sistema$]");
for(var $i = 0; $i < $rs.length; $i++){
if($rs[$i]["function"] == "login"){
login();
}
else if($rs[$i]["function"] == "new item"){
newItem();
}
else if($rs[$i]["function"] == "save"){
save();
}
else if($rs[$i]["function"] == "exit"){
exit();
}
}
As you can see, Sahi will execute the function in the order that I put it in the Excel sheet, even if in the wrong way. If I write in the Excel sheet only:
id function
1 login
2 exit
Sahi will only login in the system and exit it.
The question that I have is, is there anyway to make Sahi to execute the functions that I put in the Excel sheet without using 'if ~ else if' or 'switch case'?
This discussion has been closed.
Comments
Have a look at javascript eval.
Here is an example:
Hope that helps.
Regards,
Narayan