Reputation: 19
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:
I need to make sure that the flow is as follows:
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)
Upvotes: 0
Views: 5895
Reputation: 18517
Without more context I think that your problem is a simple typo, you get your testCase and assing to tCase_1
:
def tCase_1 = testRunner.testCase.testSuite.testCases["SubmitGenerateReport"];
However then to get the tStep_1
you use tCase
instead of tCase_1
:
def tStep_1 = tCase.testSteps["PropertyTransfer"]; tStep_1.run(testRunner, context);
Additionally if the testStep
you want to run from groovy are in the same testCase
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 the testCase
and then run it.
Hope it helps,
Upvotes: 5