Forum Discussion
hi,
you can achive the solution using below steps.
1)hit the login step
2) add a groovy script after the login step:
*************************************************************************************
import groovy.json.JsonSlurper
import java.util.Map;
import org.json.simple.parser.*;
import com.eviware.soapui.support.types.StringToStringMap
def jsonRes=context.expand('${login#response}')
def json=new JsonSlurper().parseText(jsonRes)
log.info json.session.value
def headers = new StringToStringMap()
headers.put("Cookie",json.session.value)
testRunner.testCase.getTestStepByName("getIssue").testRequest.setRequestHeaders(headers)
*********************************************************************************************************************
3) like above you can loop all the step and set the headers value in one go and run the steps.
Did my reply answer your question? Give Kudos or Accept it as a Solution.
Related Content
- 10 years ago
- 4 years ago
- 13 years ago
Recent Discussions
- 15 years ago