Soapui Sample Scripts

Print in console
log.info "Hello"

Get TestCase using groovy script
always we can call a testcase from the parent level.
testRunner.testCase.testSuite.testCases["testcasename"]

Get TestSuite
testRunner.testCase.testSuite.project.testSuites["testsuitename"]

To exceute all teststeps


import groovy.json.JsonSlurper

def tsteps= testRunner.testCase.testStepList

tsteps.each{
            step->
            if (!step.disabled){
            def test=step.name
            log.info test
            def step1=testRunner.testCase.getTestStepByName(test)
            step1.run(testRunner,context)
           
            def req = step1.getPropertyValue("request")
            log.info req
            def res = step1.getPropertyValue("response")
            log.info res      
           
            }
}

Reacties