18 January 2026:


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.

How to append variable values in array?

amruta_damruta_d Members
edited November -1 in Sahi - Open Source
I am creating the the .sah file which calls different functions (these are also .sah files) in a sequential manner.

I need to store the out put of each function in an array.

every time when the function is called the output needs to be appended to the array created.

please help me creating this ASAP.

Code so far i created for storing value to excel file is:


function AddToStatusReport($status,$Pass,$Fail)
{
var db=_getDB("sun.jdbc.odbc.JdbcOdbcDriver","jdbc:odbc:Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=C:\\sahi\\userdata\\scripts\\Data Files\\Result.xls;readOnly=False","","");

var $rs=[];
$rs[0]=[];
$rs= db.select("select * from [Sheet1$]");

db.update("update [Sheet1$] set Result ='" + $Pass + "'");

}


I need more help on the db.update function which when called every time in function should append the value to the array.

currently it is only overwriting the value of variable $Pass every time it is called.

Need guidance on this.

Thanks!!
Sign In or Register to comment.