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.
output script results to db
I assume its possible to change the source code to output the script results to a db, maybe an excel workbook or mysql db instead of the .htm output? Would you recommend me doing so? Can you give me any advice on what files to look at? We want to be able to view the results in a database so we can have a system send an email if any tests fail in an overnight running of our system. In order to do that, we need the results stored in a database.
I've played with java 5 years ago, so my java is a little rusty, but I've been looking in the record file in the source code.
Am I taking the long way to a solution, is there an easier way to record the result: pass/fail of scripts to a database other than reading the .htm files and dumping those into a db?
Thank you very much for your help and replies
I've played with java 5 years ago, so my java is a little rusty, but I've been looking in the record file in the source code.
Am I taking the long way to a solution, is there an easier way to record the result: pass/fail of scripts to a database other than reading the .htm files and dumping those into a db?
Thank you very much for your help and replies
Comments
There must be a more efficient way to input test results into a database instead of reading a text file and passing that value into a db?
Starting a testing project and am wondering what is the best way to go with this, so any input or advice is greatly appreciated. Thanks!
can you share what you had to change to log results to a db??
thanks.
Sahi, report, Sahireporter.java...generateTestReport_Db(Report report){} It then calls
Then it reads a properties file for the jdbc connection string.
Hope this helps, I can post more code if necessary. Also sorry about the formatting, not sure how this is going to turn out.
go ahead and post all the .java files, am sure somebody else will make use of them.
Now,
do these code go into my script or Sahi config file??
The code does not go into the scripts or in a config file but in the sahi.jar file.
A brief explanation of logging results to a database is as follows.
Sahi.report.java
- generateTestReport() is called.
Sahi.sahireporter.java
-generateTestReport(Report report) is called.
- I created another method, generateTestReport_db(Report report) I load the test result data into a DTO (data transfer object) and pass the DTO to the database through selectOPD(SahiDTO DTO) {}
I then load the jdbc string and parameters from a properties file that I placed in the config folder.
For error logging, I have system.out.println, which is easy to see where the code is breaking. Hope this helps.