문제

I have problem with creating test via groovy script. I need generate url in code and get response to variable.

We can use existing test by next code.

def testRunnerMap = testRunner.testCase.getTestStepByName("REST Test Request")

Can we create test by groovy ?

please help me

도움이 되었습니까?

해결책

You may be looking for something like below. I got this code from http://forum.soapui.org/viewtopic.php?f=2&t=4579

import com.eviware.soapui.impl.wsdl.teststeps.registry.GroovyScriptStepFactory
suite = context.testCase.testSuite.project.addNewTestSuite("ali")
tc = suite.addNewTestCase("test case ali")
gs = tc.addTestStep( GroovyScriptStepFactory.GROOVY_TYPE, "ali's GroovyScript" )
gs.properties["script"].value = 'log.info(\'hello world\')'
context.testCase.testSuite.project.save()
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top