1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import com.eviware.soapui.support.types.StringToStringMap
 
 //Get cookie's value from the project level properties
String cookie = context.expand( '${#Project#cookie}' )
log.info "cookie : "+cookie
 
//Put cookie to StringMap
def cookieMap = new StringToStringMap()
cookieMap.put("Cookie",cookie)
 
//Just add other test steps here if they also need cookie
def testStepList = testRunner.testCase.getTestStepsOfType(com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep.class)
log.info "Test step number : "+testStepList.size()
for (testStep in testStepList){
    log.info "Pass cookie to  test step : "+testStep.name
    testStep.testRequest.setRequestHeaders(cookieMap)
}

相关文章:

  • 2021-07-16
  • 2021-12-02
  • 2022-12-23
  • 2021-09-14
  • 2021-04-10
  • 2021-11-27
  • 2021-09-20
  • 2021-08-12
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2021-11-03
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案