Sorry about these many posts. I worked on the Groovy today and I can now output some sort of log but the useful info (log.info below). I did try context.expand earlier but it did not work for me.
Based on the raw API responses on my previous post, I would like to output only the pertinent info like the http status (204, 404, etc), <error><type> if any and the first 40 characters of </type><message> if any.
Any suggestion is appreciated.
testRunner.testCase.setPropertyValue( "TARGET-1", data[0] )
testRunner.runTestStepByName( "PT-Groovy-TAS-PUT")
tStep = testRunner.testCase.getTestStepByName("PT-Groovy-TAS-PUT")
def header = tStep.getTestRequest().response.responseHeaders
log.info " Seq="+i+" "+data[0] + " " + header
report << "\n"+"Seq="+i+" "+sdf.format(log_date)+" "+data[0] + " " + header
Sat Jul 03 14:13:40 EDT 2021:INFO: Seq=0 14313140097 [#status#:[HTTP/1.1 204 ], Date:[Sat, 03 Jul 2021 18:13:40 GMT]]
Sat Jul 03 14:13:40 EDT 2021:INFO: Seq=1 14313140098 [#status#:[HTTP/1.1 404 ], Content-Length:[280], Date:[Sat, 03 Jul 2021 18:13:40 GMT], Content-Type:[application/xml]]
Sat Jul 03 14:13:40 EDT 2021:INFO: Seq=2 14313140883 [#status#:[HTTP/1.1 204 ], Date:[Sat, 03 Jul 2021 18:13:40 GMT]]
Sat Jul 03 14:13:41 EDT 2021:INFO: Seq=3 14313140884 [#status#:[HTTP/1.1 204 ], Date:[Sat, 03 Jul 2021 18:13:40 GMT]]
Sat Jul 03 14:13:41 EDT 2021:INFO: Seq=4 14313140928 [#status#:[HTTP/1.1 404 ], Content-Length:[280], Date:[Sat, 03 Jul 2021 18:13:41 GMT], Content-Type:[application/xml]]
Sat Jul 03 14:13:41 EDT 2021:INFO: Seq=5 14313140038 [#status#:[HTTP/1.1 404 ], Content-Length:[280], Date:[Sat, 03 Jul 2021 18:13:41 GMT], Content-Type:[application/xml]]
Sat Jul 03 14:13:42 EDT 2021:INFO: Seq=6 14313141288 [#status#:[HTTP/1.1 204 ], Date:[Sat, 03 Jul 2021 18:13:41 GMT]]