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.
Not able to write 2d array to csv file or any text to plain text file!
Hi,
_debugToFile(msg, filepath); method is working in my script but when I try to write the same message using _writeToFile or _writeFile methods it doesn't work. Also, am not able to write 2 dimensional array to a csv file.
Also, in documentation of sahi present in docs folder, there is no function called _writeFile or related messages.
I used the below code to write into csv, but it didn't work:
var $ar = new Array();
$ar[0] = ["hi", "there", "one"];
$ar[1] = ["hey", "he" , "she"];
_writeCSVFile($ar, "C:/Work/sahicsv.txt", true, ",");
Please help ASAP.
Thanks in advance,
Vineet
_debugToFile(msg, filepath); method is working in my script but when I try to write the same message using _writeToFile or _writeFile methods it doesn't work. Also, am not able to write 2 dimensional array to a csv file.
Also, in documentation of sahi present in docs folder, there is no function called _writeFile or related messages.
I used the below code to write into csv, but it didn't work:
var $ar = new Array();
$ar[0] = ["hi", "there", "one"];
$ar[1] = ["hey", "he" , "she"];
_writeCSVFile($ar, "C:/Work/sahicsv.txt", true, ",");
Please help ASAP.
Thanks in advance,
Vineet
This discussion has been closed.
Comments
These APIs and your code seem to work fine. Could you please specify what happens when you say it didn't work? Are the files not getting generated or are you getting errors on Sahi reports? Could you please check and let us know?
Regards,
Narayan