• [SoapUI] 循环遍历某个Test Case下的所有Test Step,将Cookie传递给这些Test Step


    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)
    }
    

      

  • 相关阅读:
    没有上司的舞会
    邮票面值设计
    小木棍
    简单的试炼
    区间质数
    加工生产调度
    泥泞的道路
    总数统计
    中庸之道

  • 原文地址:https://www.cnblogs.com/MasterMonkInTemple/p/4602005.html
Copyright © 2020-2023  润新知