cancel
Showing results for 
Search instead for 
Did you mean: 

I need to get REST step (the best would be failed one) and log its request

tos
Occasional Visitor

I need to get REST step (the best would be failed one) and log its request

Hi,

The test cases consists of REST  type steps and groovy scripts. There is a need to log failed REST request url and body

sent. 

 

Is there any way, for example in Tear Down script to log failed REST step endpoint url and request json body which was sent?

 

1 REPLY 1
Highlighted
Contributor

Re: I need to get REST step (the best would be failed one) and log its request

An example to look at:

 

http://onetestsolution.com/blog/reading-json-request-and-response-in-soapui-using-groovy-scripting/

 

If your url endpoint was a variable, you could use that in your log because you know what it it.

 

def ep = testRunner.testCase.testSteps["Request Step"].testRequest.endpoint

JamesK
New Here?
Join us and watch the welcome video:
Watch the new Interview
Top Kudoed Authors