SOAPUIGroovy:检查测试步骤是否是soap请求

SOAPUIGroovy:检查测试步骤是否是soap请求,groovy,soapui,Groovy,Soapui,有没有办法检查某个测试步骤是否是soap请求 目前,我在测试用例的末尾有一个Groovy脚本,并循环执行所有测试步骤以记录请求和响应 我想忽略不是请求的步骤。如果这是相关信息,我将使用context.testCase.getTestStepAti访问每个步骤。是的,可以在Groovy脚本步骤中找到该步骤是否属于特定类型,如Wsdl、REST、Jdbc、HTTP、Groovy等 请使用下面的脚本进行同样的操作 import com.eviware.soapui.impl.wsdl.teststep

有没有办法检查某个测试步骤是否是soap请求

目前,我在测试用例的末尾有一个Groovy脚本,并循环执行所有测试步骤以记录请求和响应


我想忽略不是请求的步骤。如果这是相关信息,我将使用context.testCase.getTestStepAti访问每个步骤。

是的,可以在Groovy脚本步骤中找到该步骤是否属于特定类型,如Wsdl、REST、Jdbc、HTTP、Groovy等

请使用下面的脚本进行同样的操作

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

//....other stuff
//Initialise variable step before using it.
if (step instanceof WsdlTestRequestStep) {
    log.info "Found a request step of Wsdl/Soap type"
   //do the stuff you wanted

} else if (step instanceof RestTestRequestStep) {
    log.info "Found a request step of Rest type"
    //do the stuff you wanted   
} else if (step instanceof JdbcRequestTestStep) {
    log.info "Found a request step of jdbc type "
    //Do the stuff you wanted
} else if (step instanceof HttpTestRequestStep) {
     log.info "Found a request step of http type "
     //do the stuff for http                
}

是的,可以在Groovy脚本步骤中找到该步骤是否属于特定类型,如Wsdl、REST、Jdbc、HTTP、Groovy等

请使用下面的脚本进行同样的操作

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

//....other stuff
//Initialise variable step before using it.
if (step instanceof WsdlTestRequestStep) {
    log.info "Found a request step of Wsdl/Soap type"
   //do the stuff you wanted

} else if (step instanceof RestTestRequestStep) {
    log.info "Found a request step of Rest type"
    //do the stuff you wanted   
} else if (step instanceof JdbcRequestTestStep) {
    log.info "Found a request step of jdbc type "
    //Do the stuff you wanted
} else if (step instanceof HttpTestRequestStep) {
     log.info "Found a request step of http type "
     //do the stuff for http                
}