Forum Discussion

cmenard25's avatar
10 years ago

Access the running testcase using groovy

Hello all,

I am currently creating my soapui tests using Run TestCase test steps. In these steps, I make a call to an existing test case that contains a groovy script to perform some data extraction. Part of this groovy script saves data in properties for the test case and test suite, but I've found that it is not writing into the test case/test suite that I expect.

When I call a test case from a "Run TestCase" step that contains groovy script that references the testRunner.testCase or testRunner.testCase.testSuite objects, I have found that the objects that are referenced are the ones that contain the original test case, not the item actually running the "Run TestCase" test step.

Is there a way to access the "running" test suite and test case of a teststep that is running another test case?

Example:

TestSuite1 --> TestCase1 --> TestStep1 --> calls --> TestSuite2 --> TestCase2 --> TestStep2

When running the script in TestStep2, I need to reference TestCase1 and TestSuite1

Any Thoughts?

Thank you!
No RepliesBe the first to reply