My comments inline below.
The reason of this Groovy script is I have to read from an external file with hundreds of entries and execute a teststep with each entry.
As it stands now, there are at least 8 lines per execution of the teststep.
I am hoping to find a way to "flatten" the report file. I can then import this report file in EXCEL and filters out the failed API.
- in the previous question, it was answer how to access the values of node attributes using @ for ex, @resultCode, @message
--> Yes, I have learned how to read the node attributes. I like to learn how to organize these results to a report file.
- In the response provided, there is no where values available 302330000007120, 12313140098 etc
--> 302330000007120, 12313140098 are the data the Groovy read from an external file.
--> I added this line log.info " Seq="+i+" "+data[0]+", "+data[1] to identify each data entry.
--> The CSV file:
302330000006120, 12313140097
302330000007120, 12313140098
- Understand that you might to print the data in certain format. Please show the expected data to be logged from given response. I case see you mentioned print in online. But can't understand MESSAGE1, 2 etc.,
--> I am hoping to equate:
MESSAGE1 to @resultCode of FlowId=1 (changeImsiDataRequest)
MESSAGE2 to @resultCode of FlowId=1 (changeMsisdnDataRequest)
etc.
--> This way, I can use this line << "\n"+ "Seq="+i+" "+sdf.format(log_date)+" "+data[0]+" "+data[1]+" Result: ["+MESSAGE1+"] "+MESSAGE2
to output to the report file like:
Seq=0 06/24/2021 08:55:43 302330000006120 12313140097 Result: FlowId=1, Status=0, FlowId=2, Staus=0
Seq=0 06/24/2021 08:55:43 302330000007120 12313140099 Result: FlowId=1, Status=0, FlowId=2, Staus=0
- In the given response, only flowId is different, and resultCode and message are same.
--> resultCode can be different. 0=Success, 30=Inconsistent data, 40=record not found