HaroldR
8 years agoContributor
How to use $ to populate variable inside another $expression
Hello, I am trying to populate a variable value inside a $ Expression inside my groovyscript: def currentStepInd = context.currentStepIndex;
def previousStep = testRunner.testCase.getTestStepAt(...
- 8 years ago
Try this:
def currentStepInd = context.currentStepIndex;
def previousStep = testRunner.testCase.getTestStepAt(currentStepInd - 2)
def previousStepName = previousStep.name;
def response = context.expand( '${' + previousStepName + '#Response}' );
context.testCase.setPropertyValue("Response", response);