cancel
Showing results for 
Search instead for 
Did you mean: 

how to count pure SOAP request test steps

SOLVED
Highlighted
Contributor

how to count pure SOAP request test steps

Hello!

 

Under my test case, I have data sources, SOAP requests,groovy scripts.  With  testCase.testStepCount, I count all the steps. I am wondering how to get the pure SOAP request number without counting other test steps, like data source  or groovy scripts.

 

Thanks for your kind support in advance!

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Re: how to count pure SOAP request test steps

Here is the groovy script which only log the step name if test step is a soap request type

 

import com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep
log.info context.testCase.testStepCount
(0..context.testCase.testStepCount-1).each{
	def step = context.testCase.testStepList[it]
	if ( step instanceof WsdlTestRequestStep) {
		log.info step.name
	}
}


Regards,
Rao.

View solution in original post

3 REPLIES 3
Highlighted
Community Hero

Re: how to count pure SOAP request test steps

Here is the groovy script which only log the step name if test step is a soap request type

 

import com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep
log.info context.testCase.testStepCount
(0..context.testCase.testStepCount-1).each{
	def step = context.testCase.testStepList[it]
	if ( step instanceof WsdlTestRequestStep) {
		log.info step.name
	}
}


Regards,
Rao.

View solution in original post

Highlighted
Contributor

Re: how to count pure SOAP request test steps

Hello Rao,

Thanks so much for the code. You are a super hero.

Highlighted
Established Member

Re: how to count pure SOAP request test steps

 

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

count = 0
(1..context.testCase.testStepCount).each{
    def step = context.testCase.testStepList[it]
    if ( step instanceof WsdlTestRequestStep) {
        count++
        }
}

log.info count

 

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors