Forum Discussion
Lucian
7 years agoCommunity Hero
Hey,
Well if you didn't figure it out yet here is the answer... The code you can put into the groovy script can be this:
// Get the location header def vals = testRunner.testCase.getTestStepByName("TC_POST_EXTUSER").httpRequest.response.responseHeaders["Location"][0] // Set a test case property for the header testRunner.testCase.setPropertyValue( "LocationHeader", vals )
... and then you can use it in a future request like:
Cheers! :smileyhappy:
- bik7 years agoOccasional Contributor
Thanks for the solution.
I did like this because the location header value for my next request would be the endpoint .
def vals = testRunner.testCase.getTestStepByName("TC_POST_EXTUSER").httpRequest.response.responseHeaders["Location"][0]
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
return vals
GETV.setPropertyValue('Endpoint',vals)
thanks a lot Lucina for that [0] ,i could able to get rid off the square brackets. (which was my latest problem)
Related Content
Recent Discussions
- 3 hours ago
- 26 days ago