Forum Discussion
mrugglesaz
10 years agoOccasional Contributor
Forum Members:
In case anyone is interested, the attached text file contains a Groovy script that gets the SQL Query & Results for any JDBC steps that are found in a test case and then appends them to the text file(s) that are output by executing the TestRunner. The script has worked for me in most cases. The only failure I've seen is in a test where I've set up a Conditional Wait using a Conditional Goto step along with a Delay step. Because of this design, the output of my final SQL query gets written to the wrong file, but that's only a minor bug with the script. Otherwise, this script will output your SQL Query & Results for tests with single or multiple iterations to the appropriate text files.
FYI, in order to get the appropriate output directory to parse, I had to use an input box, which is displayed when the TestRunner executes. In order to see the input box displayed, you have to check the Enable UI feature on the Basic tab in the TestRunner popup window. The input box was the only way that I could find to get the same path as what is entered in the Root Folder field on the Reports tab in the TestRunner. I checked the API's and I can't find anything that let's me get the Root Folder value programmatically. This is the best design I could come up with. If anyone can improve upon it, feel free and let me know what you come up with.
Thanks,
Mark A. Ruggles
In case anyone is interested, the attached text file contains a Groovy script that gets the SQL Query & Results for any JDBC steps that are found in a test case and then appends them to the text file(s) that are output by executing the TestRunner. The script has worked for me in most cases. The only failure I've seen is in a test where I've set up a Conditional Wait using a Conditional Goto step along with a Delay step. Because of this design, the output of my final SQL query gets written to the wrong file, but that's only a minor bug with the script. Otherwise, this script will output your SQL Query & Results for tests with single or multiple iterations to the appropriate text files.
FYI, in order to get the appropriate output directory to parse, I had to use an input box, which is displayed when the TestRunner executes. In order to see the input box displayed, you have to check the Enable UI feature on the Basic tab in the TestRunner popup window. The input box was the only way that I could find to get the same path as what is entered in the Root Folder field on the Reports tab in the TestRunner. I checked the API's and I can't find anything that let's me get the Root Folder value programmatically. This is the best design I could come up with. If anyone can improve upon it, feel free and let me know what you come up with.
Thanks,
Mark A. Ruggles
Related Content
- 3 years agoHenrikHL