Forum Discussion
StevenColon
SmartBear Alumni (Retired)
Thank you for posting to our Community Forum.
Here is a script that you can insert in the "Teardown Script" field of each TestSuite which writes the results to a file:
fos = new FileOutputStream('C:/temp/test-log.txt', true ) pw = new PrintWriter( fos ) pw.write(testSuite.name + ": "+runner.status.toString()) pw.close() fos.close()
Since you need to write this into a DB, you can replace the file-writing code with JDBC code to write into a specified DB. Unfortunately I do not have a sample of that but this should help you.
Let me know if you have any questions/concerns.
dief123
7 years agoOccasional Contributor
Thank you for this help! Using this in the TestSuite TearDown script, the results is writes is "Finished". It does not
give Pass/Fail status. I'm trying to write to a database we use for a system dashboard and would like to show the pass/fail results. Is there a way to do that?
Related Content
- 5 years agoPG
- 12 years agomaheshwari_a