Karate API: print the error message details?

Viewed 21

I am running a test against 250 metrics and trying to give a csv file to the engineers with status code for each and messageDetails to help them troubleshoot faster. Yes, I could send them the Karate results, but then they have to click on every failure and can't assess the state in one view. I would think I could print the error message details, but I have had no luck. Here is what the response looks like when status code is not 200. Any idea how to print the messageDetails?

enter image description here

2 Answers

Have you tried * print 'details:', response.messageDetails

Actually, the main issue was that I was calling it from another file, so I needed to do: response.response.exceptionData.MessageText

(I guess I should have called it result.response.exceptionData.MessageText to make it less confusing).

Related