Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // helpers for JSON Parser
- import groovy.json.JsonSlurper;
- // get the previous stepIndex by deducting 1 from the current step
- def previousStepInd = context.currentStepIndex - 1;
- // get previous test name
- def previousTestStepName = context.testCase.getTestStepAt(previousStepInd).name;
- // get previous test step response
- def responseBody = testRunner.testCase.testSteps[previousTestStepName].testRequest.response.contentAsString;
- def jsonBody = new JsonSlurper().parseText(responseBody)
- testRunner.testCase.testSuite.setPropertyValue( "orderId", jsonBody.orderPlacementResponse.orderId );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement