Sunday, February 15, 2015

Run test step depending on status of a different test step in SoapUI using Groovy Script

testRunner.testCase.testSuite.project.name
import com.eviware.soapui.model.testsuite.TestStepResult.TestStepStatus
import com.eviware.soapui.impl.wsdl.WsdlTestSuite
import com.eviware.soapui.impl.wsdl.teststeps.WsdlTestStep


myTestStepResult = testRunner.testCase.testSuite.getTestCaseByName("testCase_1").getTestStepByName("testStep_2").run(testRunner, context)
myStatus = myTestStepResult.getStatus()
if (myStatus == "OK")
testRunner.gotoStepByName("testStep_3")
else{
def tCase = testRunner.testCase.testSuite.testCases["Name of test cases"]
def tStep = tCase .testSteps["test step you want to run"]
tStep.run(testRunner, context)
}

No comments:

Post a Comment