Forum Discussion
jigarpatel
10 years agoNew Contributor
//From first TestStep read JSON string in a variable and then set it as property in the third test step
//Here I assume you already have a way to read JSON file
def jsonString = '{"name":"John Sid"}'
def targetTestStepIndex = context.currentStepIndex + 2
context.testCase.getTestStepAt(targetTestStepIndex).setPropertyValue("propertySetFromFirstStep", jsonString)
In 3rd Step request, you probably don't want quotes around json object.
{
"body": ${propertySetFromFirstStep}
}
Related Content
- 10 months agoKimdoengart
- 2 years agoTaz
- 4 years agoavin
Recent Discussions
- 6 days agoemoya