Call test step of another test case through Groovy
Hi friends,
A common test scenario to call test step of another test case in SoapUI. My question is that how does called test step (REST GET request) retrieve property value? (i.e. one parameter is ${#TestCase#userID}). when I call this step using below Groovy code:
(Example)
Case 1
REST Step 1
REST Step 2
Case 2
Groovy Step 1
// call "REST Step 1" of Case 1 in Case 2 def targetTestStep = testRunner.testCase.testSuite.testCases["Case 1"].testSteps["REST Step 1"] targetTestStep.run(testRunner, context)
"REST Step 1" has a parameter with "${#TestCase#userID}", if run above code, the "REST Step 1" cannot get property value from "Custom Properties" of test case. It seems retrieve property value from caller's properties rather than called one. is it about "testRunner"?
If I want called test step to get property value from its own test case. How can I proceed it?
Thanks
Regards,
/Aaron
While I have not actually tried this, the documentation...
https://support.smartbear.com/readyapi/docs/testing/properties/expansion.html#scopes
...states "To refer to properties in other test suites or test cases, use the full "path" to specify the desired scope.
The "path" part is enclosed in square brackets.", with the example:${#[Suite name#Case name#Step name]#Property name}
Take a read of the docs for a more complete explanation.