How to use processId from response in following calls for E2E flow

Hello,

I am very new with using Katalon and I need help with the following situation:
I have a POST request which provides me with a response. Within the response i have a processId which i wish to use in another PUT request.

I have no experience using groovy and i wish for a way to do this manually. Basically extract the newly generated processId from the first call and using it in the following ones.

I appreciate any help regarding this. If additional info is required please ask :slight_smile:

post example of response please so we can help you
in general (if response is JSON)
processing can look like:

assert response['status'] == 200def responseJSON = new JsonSlurper().parseText(response['text'])println responseJSON[1].name

1 Like

Andrej PodhajskĂ˝ said:

post example of response please so we can help you
in general (if response is JSON)
processing can look like:

assert response['status'] == 200def responseJSON = new JsonSlurper().parseText(response['text'])println responseJSON[1].name

  

The actual response is:

{

“actionType”:“url.process.ManualInputStepAction”,

“processId”:“50fd9g30-65c2-4c9d-8b25-16729a7d4d21”,

“displayMessage”:“Provide Process”,

“parameters”:{

"registrationType":"String"

},

“stepName”:“provide-process”,

“lastStep”:false

}

the processId is uniquely generated on each call and expires after some time or after the flow is complete… i need to write my Test in such a way that it can be reused.

In postman i managed to do it like this:

var jsonData = JSON.parse(responseBody);

var processId = jsonData.processId;

postman.setEnvironmentVariable(“processId”, processId);

and in the following requests i would just place {{processId}} and take the one generated at the last step.

Also, thank you for the fast reply.

def jsonData = new JsonSlurper().parseText(response['text'])
def processId = jsonData.processId;

allmost same