MikeSchoolik
10 years agoOccasional Contributor
Rest Project RequestFilter.afterRequest Target issue
On a rest project at the project level I have an event :RequestFilter.AfterRequest with a target for a given step as "Authenticate.aspx - Request 1".
The groovy script for it is (stripping out extra characters):
if( request.response == null )
return
// get response content
def content = context.httpResponse.responseContent
//def tvar
// manipulate content
//tvar=content[0..35]
//log.info (tvar)
content=content [0..35]
log.info (content)
// write it back
context.httpResponse.responseContent = content
When I run this, it doesn't work at all. If I strip out the target, it works for just the individual step
but not the suite (I only want it to run for this step for as I only want it on this step)
My goal is to strip out extra characters for a key and then pass it off to the additional steps that are all request which use this generated key. The key changes with each run.
Any ideas?
The groovy script for it is (stripping out extra characters):
if( request.response == null )
return
// get response content
def content = context.httpResponse.responseContent
//def tvar
// manipulate content
//tvar=content[0..35]
//log.info (tvar)
content=content [0..35]
log.info (content)
// write it back
context.httpResponse.responseContent = content
When I run this, it doesn't work at all. If I strip out the target, it works for just the individual step
but not the suite (I only want it to run for this step for as I only want it on this step)
My goal is to strip out extra characters for a key and then pass it off to the additional steps that are all request which use this generated key. The key changes with each run.
Any ideas?