Does anyone know how I can have my script check the log results to see if there are any failures? I have searched the posts, but haven't found anything that I can use.
Here is what I am doing/need:
-I am developing a series of scripts that would be used for post-production deployment checkout. Operations want to be notifed, via email, if the script fails.[Note - I have the email piece working]
Here is where I am stuck:
1. I haven't figured out how to query TP DB to get the results.
2. How do I report the results of the driver script when it is still running?
I suspect that I am complicating things...
Thanks for your help.
With TP 6.0, you can pass data between driver scripts & driven scripts using global variables in a shared module. Each driven script can report it's pass/fail status back to the driver which in turn can shoot out an email on a script by script basis.
You could e.g. implement an error handler which writes script failures to your own db. And/or: Let each script write it's status. At the beginning of a script execute a function which sets the script status in your db to "running" and at the end to "completed" or so.
Thanks for your constructive replies.
I *finally* looked into the error handling piece and seems relatively easy to implement [well, at least it appears to be]. I am debating on whether or not to write the results to a text file or add it to the log [and then export to xml].
I am a newbee and I hope your issue was sorted out. Can you please englighten me on the process you have followed to log the script results.
I'll explain my scenario
1.I am using TP 5.4 Build 180
2. I need to run a single driver/master script after every build and that has 10 scripts in it.I am still figuring out on how this can be done?
3. I am looking to write the results of each script (pass/fail/exceptions) to a log file (xls or xml or txt will do). I don't want the driver script to fail if one of the scripts in it fails ( i mean it should run all of them)
The following query will work against a testpartner schema on Access or SQL server:
SELECT rh.TPNAME, rh.TPID, rh.TPLASTMODIFIEDDATE, rh2.TPSTATUS, rh2.TPRUNDESCRIPTION FROM TP_ASSETMAIN rh, (SELECT TPNAME, TPID FROM TP_ASSETMAIN WHERE TP_ASSETMAIN.TPOBJECTTYPE=43 GROUP BY TPID, TPNAME)
"maxresults, TP_RESULTS_SUMMARY rh2 WHERE rh.TPID = maxresults.TPID AND rh.TPNAME= maxresults.TPNAME and rh.TPID = rh2.TPID
This will give you the results for all test scripts. a rh2.TPSTATUS of 2 is a fail and a rh2.TPSTATUS 3 is a pass.
You need to write some sort of a front end (refer pic as example).
Csaba - Very impressive front end. We have taken the approach of writing our test results to an external xls file that tracks the info on each test ran and the results. It is also used to track any errors that a script throws.
I liked the idea of exporting just the log files to an xml file. I am going to play with that and see what I can come up with.