Is there any way in which I can run a Property Transfer
step from a groovy script
? Both are in the same test case.
Test case contains the following test steps:
- groovy script
- soapUI request (GetAccountNumber)
- property transfer step (transfers a response property from above to a request property in the below step)
- soapUI request (DownloadURL)
I need to make sure that the flow is as follows:
- Groovy runs and reads numbers from a file and passes them to GetAccountNumber.
- GetAccountNumber runs with the passed values and generates a response.
- This response is passed by the property transfer step to DownloadURL.
- DownloadURL runs with this passed value and generates an output.
All I need to do is run the Property Transfer from the groovy because the other steps can be run from groovy.
It isn't running with the following code
def testStep_1 = testRunner.testCase.getTestStepByName("PropertyTransfer")
def tCase_1 = testRunner.testCase.testSuite.testCases["SubmitGenerateReport"]
def tStep_1 = tCase.testSteps["PropertyTransfer"]
tStep_1.run(testRunner, context)
Without more context I think that your problem is a simple typo, you get your testCase and assing to
tCase_1
:However then to get the
tStep_1
you usetCase
instead oftCase_1
:Additionally if the
testStep
you want to run from groovy are in the sametestCase
you're executing; you can run it simply using:testRunner.runTestStepByName('some teststep name')
Which I think it's more convenient than get the
testStep
from thetestCase
and then run it.Hope it helps,