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.
how to pass the log file results directly to Excel
I am running a script, after execution of the script i would need to pass the log results in an excel sheet. The results will be stored in logs, playback folder. Also, the file name will be stored with current date and time. So I can't able mention the path of the file along with file name. I would need to get the log result of the file which i have executed last.
Is there any other possible way to handle this. Kindly help me.
Thanks in advance
Is there any other possible way to handle this. Kindly help me.
Thanks in advance
Comments
This is a ugly hack, and we will mostly provide you a better API soon, but meanwhile use this:
$logFileName = ScriptRunner.getReport().getTestSummary().getLogFileName() + ".htm";
_log($logFileName);
Regards,
Narayan
Thanks for your reply.
I tried with this:
$logFileName = ScriptRunner.getReport().getTestSummary().getLogFileName() + ".htm";
_log($logFileName);
It displays the last run file name[entire]. But what I need is, entire log file content should be copied to an Excel sheet automatically.
And, along with this I try to use _readFile() to mention the path of my file. I tried like this,
_readFile("C:/sahi/userdata/logs/playback/$logFileName");
I got an error like this below:
JSERROR
Wrapped net.sf.sahi.util.FileNotFoundRuntimeException: java.io.FileNotFoundException: C:\sahi\userdata\logs\playback\$logFileName (The system cannot find the file specified)
But when I mention the path like below i got the solution.
_readFile("C:\sahi\userdata\logs\playback\Calibration_Smoke_Test__01Apr2010__12_00_46");
My situation is I can't able to pass the file name directly in this path.
Kindly reply me.
_readFile("C:/sahi/userdata/logs/playback/$logFileName");
should be
_readFile("C:/sahi/userdata/logs/playback/" + $logFileName);
Regards,
Narayan
thanks for your help..
I tried with this
_readFile("C:/sahi/userdata/logs/playback/" + $logFileName);
but i got like below mentioned error.
Wrapped net.sf.sahi.util.FileNotFoundRuntimeException: java.io.FileNotFoundException: _sahi._setFile(_sahi._file("file"), "C:\sahi\userdata\logs\playback\sds__01Apr2010__15_01_52.htm") (The filename, directory name, or volume label syntax is incorrect) at Apr 3, 2010 5:06:50 PM
Kindly help me....
In last post i wrongly mentioned about error.
i got error like this
JSERROR
Wrapped net.sf.sahi.util.FileNotFoundRuntimeException: java.io.FileNotFoundException: C:\sahi\userdata\logs\playback\s__03Apr2010__15_39_55.htm (The system cannot find the file specified) at Apr 3, 2010 3:39:55 PM
kindly help me...
Check the path to see if it is correct on your file system. As the error says, the file does not exist. The only problem could be that the path is incorrect.
Is possible to convert all log files into excel file by using sahi script...
kindly help me...
how should i pass result of log files into excel sheet.i want to create reports..So what code should i write..
Thanks..
can u please explain me proper functioning for _log using some example.
Like take a login screen.and there are three test cases.
1.both correct values
2.both incorrect
3.null
i want to generate report using _log..so that values automatically comes in excel sheet..
Please help me out.Waiting for your reply
Thanks.
Currently Sahi has only HTML logs. For excel logs, you will have to either do your own parsing of the HTML log files or use _getDB to write to an Excel File, or contact us for custom development.
Regards,
Narayan
how should i parse html log files.