Hello everyone, I’m trying to create a Gatling script with Java, and met with quite a big problem for me.
So this is my issue:
I have a scenario that looks like so:
.exec(ChainBuilder)
.exec(ChainBuilder)
.exec(ChainBuilder)
.exec(ChainBuilder)
.exec(function(value1)) //returns ChainBuilder, where one of the request inside uses that param .repeat(4).on(exec(function2(value1))) //returns ChainBuilder, where one of the request inside uses that parameter
.repeat(4).on(exec(function2(value2))
When function2 is called the first time it uses value1, when it is called the second time it still uses value1 and not value2
I understand that Gatling compiles methods only once, but I don’t want to create a lot of identical methods, so the question is, how can I work around it?
(I’m sorry that I didn’t provide a code, but the reason is that I can’t show endpoints and data)
The script that you wrote is identical to mine, so I guess that I’m missing something in the script that I’m writing. So I guess I will need to reconfirm everything, thank you for the pointers!