[SoapUI] 检查测试步骤的类型或者或者某种特定类型的步骤列表

SoapUI Groovy : Check if test step is of specific type, such as : Wsdl, Rest, Jdbc, HTTP, Groovy etc

import com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep
import com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep
import com.eviware.soapui.impl.wsdl.teststeps.JdbcRequestTestStep
import com.eviware.soapui.impl.wsdl.teststeps.HttpTestRequestStep

if (step instanceof WsdlTestRequestStep) {
    log.info "Found a request step of Wsdl/Soap type"
} else if (step instanceof RestTestRequestStep) {
    log.info "Found a request step of Rest type"
} else if (step instanceof JdbcRequestTestStep) {
    log.info "Found a request step of jdbc type "
} else if (step instanceof HttpTestRequestStep) {
    log.info "Found a request step of http type " 
}

  

SoapUI Groovy: Get all test steps of specific type

import com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep

def testSuiteList = testRunner.testCase.testSuite.project.getTestSuiteList()
for(testSuite in testSuiteList){
    testCaseList = testSuite.getTestCaseList()
    for(testCase in testCaseList){
        testStepList = testCase.getTestStepsOfType(RestTestRequestStep)
        for (testStep in testStepList){
            testStepName = testStep.name
        }
    }
}            

More test step types please see from SoapUI API documentation:
https://support.smartbear.com/readyapi/apidocs/soapui/com/eviware/soapui/impl/wsdl/teststeps/package-summary.html 

转载于:https://www.cnblogs.com/MasterMonkInTemple/p/10558005.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值