zoukankan      html  css  js  c++  java
  • [SoapUI] 循环遍历某个Test Case下的所有Test Step,将Cookie传递给这些Test Step

    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)
    }
  • 相关阅读:
    Unable to load dbxmss.dll (ErrorCode 16). It may be missing from the system Path
    同一网内机器无法连通解决一例
    Day.24
    Day.24
    Day.23
    Day.22
    Day.23
    Day.21
    Day.22
    Day.01-Day.20
  • 原文地址:https://www.cnblogs.com/feifeidxl/p/4602949.html
Copyright © 2011-2022 走看看