jsontester
4 years agoOccasional Contributor
Using partitial value in a request
I want to use partitial value in my request from a earlier response. I can use tranfer property or use get data but then I get the whole value and not a part what I need in my request.
As example: In a earlier response I have value 00123456789 in a property "id"
Now I want to use the first 8 digits in my next request. That's 00123456
How can I use a part of the value in my request?
jsontester : You can use below code sample, it is the implementation what richie has suggested you
import groovy.json.JsonSlurper def response = testRunner.testCase.getTestStepByName("TEST__STEP__NAME").getPropertyValue("Response") slurperRes = new JsonSlurper().parseText(response) def val = slurperRes.PATH__TO__VALUE def desired_Val = val.take(8) log.info desired_Val