dsw
14 years agoNew Contributor
Invoking a TestCase and passing in the current "context"
I want to invoke a TestCase from a groovy script TestStep and pass in the current TestCaseRunContext context.
The invoked TestCase will update properties in the context (ie: context.prop1 = "hello" ). Upon return the invoking TestStep (groovy script) will use the properties set by the TestCase.
I'm having trouble finding a method to do this. Here is some example code:
// lookup the test step script
def tc = testRunner.testCase.testSuite.project.testSuites["xyz"].testCases["abc"]
// run the TestCase - which sets context.prop1
def rc = tc.run(new StringToObjectMap( context ), false)
log.info context.prop1 // not set
I can't figure out how to pass in and use the current TestCaseRunContext. I don't want to create a new one for the TestCase.
I'm fairly new to SoapUI. I am I missing something?
The invoked TestCase will update properties in the context (ie: context.prop1 = "hello" ). Upon return the invoking TestStep (groovy script) will use the properties set by the TestCase.
I'm having trouble finding a method to do this. Here is some example code:
// lookup the test step script
def tc = testRunner.testCase.testSuite.project.testSuites["xyz"].testCases["abc"]
// run the TestCase - which sets context.prop1
def rc = tc.run(new StringToObjectMap( context ), false)
log.info context.prop1 // not set
I can't figure out how to pass in and use the current TestCaseRunContext. I don't want to create a new one for the TestCase.
I'm fairly new to SoapUI. I am I missing something?