10-12-2017 09:37 AM
I am constructing a dashboard for our systems and would like to know how to send testsuite output to a database (MSSQL). I configured the database connection in SoapUI Pro and can ping the database from the server that ReadyAPI runs on.
Is there a way to send testsuite results directly to a database?
10-13-2017 12:23 PM
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.
10-13-2017 02:30 PM
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?
Once again thank you for the help! We actually would like to ask anyone who reads this if they could provide the script we need to write to a database instead of the file.