Forum Discussion
JHunt
7 years agoCommunity Hero
Sorry, above script works but it's a bit misleading, because there aren't separate entries on responseHeaders for each Set-Cookie header. This may be more appropriate:
def sessionidPair
def token1Pair
testRunner.testCase.getTestStepByName("1st test step").testRequest.response.responseHeaders["Set-Cookie"].each {
if (it.contains("sessionid=")) sessionidPair = it
if (it.contains("token1=")) token1Pair = it
}
testRunner.testCase.getTestStepByName("2nd test step").testRequest.requestHeaders += ["Cookie": ["${sessionidPair};${token1Pair}".toString()]]
Related Content
- 10 years ago
- 12 years ago
Recent Discussions
- 14 hours ago