Forum Discussion
Florin_Neamtu
13 years agoOccasional Contributor
I'm actually trying to use the groovy hack to read the ETag header from a HTTP response and set it into a HTTP request header of a subsequent request.
I managed to read the ETag header from a response and save it into a property (as described in the above Groovy script), but from here I can't figure out how to set the HTTP request header of another Test step to this value. I tried using another Groovy script but it doesn't seem to work (raises an exception) ... or I don't know which properties to use on "testRequest" object. Any idea?
Thanks.
I managed to read the ETag header from a response and save it into a property (as described in the above Groovy script), but from here I can't figure out how to set the HTTP request header of another Test step to this value. I tried using another Groovy script but it doesn't seem to work (raises an exception) ... or I don't know which properties to use on "testRequest" object. Any idea?
def httpRequestHeaders = context.testCase.testSteps["delete site 1 for customer 1"].testRequest.requestHeaders
httpRequestHeaders["ETag"] = "282892923"
Thanks.