Gatling - how to pass different values from 1st request's response into next request

Hi All,

I am struggling with following issue in Gatling (scala).

Body Response of first Request

{“abcID”:“2200cjH”,“abcID”:“23xxx”,",“abcID”:“24YCg”,“abcID”:“25YCgg”,“abcID”:“25YCg”,} and so on…

I have to pass all the above mentioned multiple values of abcID from body response of first request in next http request, but currently it passes first value of abcID retrieved in response of first request, so same values passed multiple times into second request.

for example

Request parameters passed of second request

params=

abcID: 2200cjH,2200cjH,2200cjH,2200cjH,2200cjH,2200cjH, and so on…

I would be highly appreciated if you could guide with an example (as I am novice with Gatling) that how to pass these different multiple values (shown in the example for the first request) correctly in a next http request please?

Thanks & Regards,

Rushabh

Send your code so we can point out what is wrong.

Hi John,

I am really sorry. I cannot send a code as i have limitation. Let me know in case if you need further more details on this.

Thanks & Regards,
Rushabh

If you can’t post your code, then post code that does not contain anything confidential, but which exhibits the same behavior. Barring that, we can’t help you.

Hi All,

My issue is resolved and works fine now by using following method.

To get the value from jsonPath

.check(jsonPath("$.elementVOList[*].abcID").findAll.saveAs(“abcID”)))

To pass the value from following method

.formParam(“abcID”, “${abcID(0)},${abcID(1)},${abcID(2)},${abcID(3)}”) and so on…

Regards,

Rushabh