2
votes

I have Test case starts with Groovy Test step and followed with Property and 4 SOAP request test steps. In groovy Test step I performing execution of those SOAP requests, accessing data from property Test step.

Here I just want to execute those SOAP request from groovy test step alone. When I ran it as Test Case in SOAPUI after Executing groovy Test step, those 4 SOAP requests also get executed and my Test case got failed.

I use testRunner.cancel("Skip the Teststep") it could skip those test step, But it results as failure in Execution report and I cant find any method to skip test step using groovy.

Please help me somebody on this.

Regards, Madhan

2

2 Answers

2
votes

Try this in the Groovy Script step.

testRunner.testCase.testSteps.each{k, v ->  
    if(k in ['step1', 'step2']) 
        v.cancel()
}

where step1 and step2 are the steps you want to skip.

0
votes

If you want to cancel all the test steps then use

testRunner.testCase.testSteps.each{k, v ->    
testRunner.cancel(k)

if want to disable test steps

def testSuite = context.testCase.testSuite;
def totalTestCases = testSuite.getTestCases().size();

for(n in (0..totalTestCases-1))
{    
     testSuite.getTestCaseAt(n).setDisabled(true)
}